-
Notifications
You must be signed in to change notification settings - Fork 540
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
PyYAML pip import fails with python3 #33
Comments
It looks like PyYAML selects which tree to install based upon the version of Python that is currently running: https://github.com/yaml/pyyaml/blob/master/setup.py#L287 . Is is possible that Bazel isn't running |
Yes, that's exactly right. Unfortunately this will be hard to fix, since Bazel is in a "transition" state right now regarding how it handles multiple Python interpreters, but we can take a look to see if there is a workaround. |
One workaround that immediately comes to mind is:
|
Ignore my previous workaround # 1, reading comprehension fail. We have this same issue internally in Blaze, but the specifics and the fix are different. |
@duggelz It sounds like there's a dependency on some Bazel work, then. Is there a Bazel issue one could follow for that work? Any ETA, or is it just "this should get done sometime, we don't know when"? |
@duggelz I've worked around my local issue by just using However, it still feels like we'd want to solve this in the general case, for times when there isn't going to be a workaround. |
@duggelz @mattmoor It looks like this might also be related to bazelbuild/bazel#3871 ? |
Ping. I'm still interested in helping get this fixed, but need a few pointers. |
Ping... |
For reference, I implemented a (not-super-awesome, but functioning) workaround for loading Python 3 PyPi packages: joshclimacell@90a70d5 |
We need something like a |
This affects |
Also, I'd love to see @joshclimacell's patch in this repo. |
Any update on this? |
Using this repository:
But forcing python 3 gives an error:
This doesn't happen with all packages pulled in through pip, just PyYAML. I believe it might be related to the way that PyYAML handles py2/3 compat: instead of enabling the same code to run under both environments, PyYAML has a separate tree for each version internal to the package, and presumably selectively installs one or the other depending on the request. It doesn't look like Bazel is picking the right tree when running under python3.
The text was updated successfully, but these errors were encountered: