-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import other package under google namespace if install protobuf #4189
Comments
To reproduce:
It should print out "hello". |
I don't think this is anything particular to I believe that the issue we're hitting is the |
Having conflicting entries in My advice: Don't ever touch @fengli79 why are you creating a |
Note that when you run a Python script from the command line, Python adds the directory containing that script to the import path list. (This means that if you run "foo/bar.py", then @jonparrott Setting I think the real problem is that the original post is trying to use |
This is what I meant, but it's actually a little more insidious that than. Installed namespace packages typically create a
Not necessarily. The real solution is to install the test package using |
Any updates? |
Related from the docs: http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-init-py-trap In short: Do not use an |
Yo Google this is seriously ridiculous. People have been having this issue for going on 5 years. It shouldn't take me hours of work to try to fix this. All I want is to be able to use the google-cloud-vision Python package and no matter what I do I can't avoid protobuf not being properly recognized. When are you going to address this? Ubuntu 20.04 |
I'm also having issues with this along with https://github.com/googleapis/googleapis. Originally I filed bazelbuild/rules_python#577, but looks like the issue is here? I created an example workspace that can be used to reproduce the issue. I'm using:
|
Sorry to bump an old issue, but I figured I'd share my experience with this problem for other Bazel users. The key to avoiding this problem is A related issue was raised in #4658 and a change was merged which fixed the problem. Without the I was actually in the process of putting together a PR to add In summary, Bazel users have to opt-in to not break the |
fuck u google |
Thanks for your sharing. |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it. This issue was closed and archived because there has been no new activity in the 14 days since the |
I get the same issue (#1296 (comment)) when using protobuf 3.5.1.
The protobuf is installed in:
site-packages/
google/
protobuf/
init.py
There's no "init.py" install under the google package, and I have to import the google.protobuf package to make other packages under the google namespace be available.
The text was updated successfully, but these errors were encountered: