Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pip_import doesn't work with tensorflow #71

Copy link
Copy link
Closed
@vertix

Description

@vertix
Issue body actions

WORKSPACE

http_archive(
    name = "io_bazel_rules_python",
    sha256 = "0d1810fecc1bf2b6979d2af60e157d93d3004805bd8b7fda6eb52dda13480dca",
    strip_prefix = "rules_python-115e3a0dab4291184fdcb0d4e564a0328364571a",
    urls = ["https://github.com/bazelbuild/rules_python/archive/115e3a0.tar.gz"],
)

load("@io_bazel_rules_python//python:pip.bzl", "pip_import")

pip_import(
    name = "pip",
    requirements = "//:requirements.txt",
)

load("@pip//:requirements.bzl", "pip_install")

pip_install()

requirements.txt

tensorflow

BUILD

load("@io_bazel_rules_python//python:python.bzl", "py_binary")
load("@pip//:requirements.bzl", "requirement")

py_binary(
    name = "test",
    srcs = ["test.py"],
    deps = [
        requirement("tensorflow"),
    ],
)

test.py

import tensorflow as tf

if __name__ == "__main__":
  pass

Raises:
ImportError: 'No module named tensorflow'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.