You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside where the py_library() is generated for each specified requirement, the import path is specified as "." (https://github.com/bazelbuild/rules_python/blob/master/rules_python/whl.py#L149). While this works for most packages, not all packages have the python module in the top level of the whl. For example, the tensorflow python module is inside tensorfow-<version_info>.whl/tensorfow-<version_info>.data/purelib/tensorflow. Because of this, import tensorflow will fail in a py_binary that has requirement("tensorflow"). What I believe rules_python/whl.py should be doing is to check whether the top-level folders have an __init__.py file inside of them, and if not, search the directory tree until it finds them.
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue @WesleyYue. This is a huge blocker for us as well and I believe there is related info in #71 (and apt-itude/rules_pip#15).
rules_python 0.1.0 has been released which upstreams the rules_python_external repo. Please switch from pip_import to pip_install which doesn't have this issue.
Inside where the py_library() is generated for each specified requirement, the import path is specified as "." (https://github.com/bazelbuild/rules_python/blob/master/rules_python/whl.py#L149). While this works for most packages, not all packages have the python module in the top level of the whl. For example, the tensorflow python module is inside tensorfow-<version_info>.whl/tensorfow-<version_info>.data/purelib/tensorflow. Because of this,
import tensorflow
will fail in a py_binary that has requirement("tensorflow"). What I believe rules_python/whl.py should be doing is to check whether the top-level folders have an __init__.py file inside of them, and if not, search the directory tree until it finds them.The text was updated successfully, but these errors were encountered: