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
When using these rules with a family of pip packages (e.g. azure and google packages) which install as part of the same "namespace", python is unable to import them at runtime.
For example, if I try to use azure-mgmt-compute which provides the azure.mgmt.compute module and azure-mgmt-resource which provides the azure.mgmt.resource module, I run into this issue since they both install into the azure top level module. My pylint rules complain
ben.py:10:0: E0611: No name 'mgmt' in module 'azure' (no-name-in-module)
ben.py:10:0: E0401: Unable to import 'azure.mgmt' (import-error)
as well as when I go to actually run the packaged up par:
File "path/to/file/ben.py", line 14, in <module>
from azure.mgmt import compute, network, resource
ModuleNotFoundError: No module named 'azure.mgmt'
The build of the target succeeds, so only at run time does it fail.
I've found that this seems to be a known issue with bazel's rules_python which I found through this issue which I found through this issue (where this rule set is said to possibly fix this issue).
The repo for rules_python_external seems to have solved this issue and after doing some digging, it looks like they handle this by detecting and treating those "namespace" packages on wheel extraction.
The text was updated successfully, but these errors were encountered:
When using these rules with a family of pip packages (e.g.
azure
andgoogle
packages) which install as part of the same "namespace", python is unable to import them at runtime.For example, if I try to use
azure-mgmt-compute
which provides theazure.mgmt.compute
module andazure-mgmt-resource
which provides theazure.mgmt.resource
module, I run into this issue since they both install into theazure
top level module. My pylint rules complainas well as when I go to actually run the packaged up par:
The build of the target succeeds, so only at run time does it fail.
I've found that this seems to be a known issue with bazel's
rules_python
which I found through this issue which I found through this issue (where this rule set is said to possibly fix this issue).The repo for rules_python_external seems to have solved this issue and after doing some digging, it looks like they handle this by detecting and treating those "namespace" packages on wheel extraction.
The text was updated successfully, but these errors were encountered: