Pip using python2 even if running build script with python3
See original GitHub issueIf I start my build script like this
python3 build.py --build outdated
It will still use pip2 to install the conan packages, see packager.py
Assuming pip == pip2, which it normally is
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to use pip with Python 3.x alongside Python 2.x
The approach you should take is to install pip for Python 3.2. You do this in the following way: $ curl -O https://bootstrap.pypa.io/get-pip.py...
Read more >Porting Python 2 Code to Python 3 — Python 3.11.1 ...
Note: Using python -m pip install guarantees that the pip you invoke is the one installed for the Python currently in use, whether...
Read more >Using Python's pip to Manage Your Projects' Dependencies
In this example, you run pip with the install command followed by the name of the package that you want to install. The...
Read more >How to install Python 3 on Red Hat Enterprise Linux
You can still run Python 2 by typing python2 , python2.7 , or /usr/bin/python . It is recommended that you use a version...
Read more >pip-tools - PyPI
pip -compile should be run from the same virtual environment as your project so conditional dependencies that require a specific Python version, or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, a parameter/environment variable would be helpful. Even better would be automatic detection, but that might be a bit tricky if the naming of python/pip binaries are not standardized across platforms.
To detect the running environment you can use
sys.version_info
, and if that is version 3, then try usingpip3
, otherwisepip2
. Maybe you need something like this to check if the those binares are available. If not, fall back topip
.I’d like to get this feature as well 😄