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
{{ message }}
Repository navigation
pip import results in python3 incompatible libraries #220
pip_import is using 'python' hardcoded, which in many cases (urllib2, psutil and several others) results in Python 2 libraries that are not compatible with Python 3.
Since this is blocking my team, I created a local copy of pip.bzl and patched it just for now. I'm not sure what is the appropriate way to approach this. If there is a way to get the PY/3 interpreter path from Bazel, a fair solution can be to add a python_version parameter to the import rule.
Seems like an essential feature for Python 3 support and I will be happy to contribute a PR if we can decide on a solution. WDYT?
Reacted by Bart Römgens, Travis Clarke, Hiroaki Oyaizu, Jonathon Belotti and Keith Smiley
There's also rules_pip, which offers a python_interpreter attribute to solve this on its pip_repository rule. This is the solution I have had to use until there's support in rules_python, although rules_pip actually subjectively has a nicer interface for using the fetched packages.
Thanks @aaliddell! I was unaware of rules_pip and will definitely take a look.
Seems like #42 and #119 are also related to the same core issue, but I haven't seen any progress on either of them for a very long time.
Python 2 will be officially past EOL come 2020: https://pythonclock.org/
This is an important issue to resolve before teams can start switching to Python 3.
Activity
aaliddell commentedon Aug 6, 2019
There's a few open PRs about this issue, with varying solutions:
There's also rules_pip, which offers a
python_interpreterattribute to solve this on itspip_repositoryrule. This is the solution I have had to use until there's support in rules_python, although rules_pip actually subjectively has a nicer interface for using the fetched packages.sha1n commentedon Aug 7, 2019
Thanks @aaliddell! I was unaware of rules_pip and will definitely take a look.
Seems like #42 and #119 are also related to the same core issue, but I haven't seen any progress on either of them for a very long time.
I'll keep following.
ali5h commentedon Sep 21, 2019
also check this https://github.com/ali5h/rules_pip_lock
lshamis commentedon Oct 29, 2019
Python 2 will be officially past EOL come 2020: https://pythonclock.org/
This is an important issue to resolve before teams can start switching to Python 3.
brandjon commentedon Nov 12, 2019
This should be resolved imminently. Dedupping this issue to #249.