question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pip using python2 even if running build script with python3

See original GitHub issue

If 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

https://github.com/conan-io/conan-package-tools/blob/60ed0b215e704092beb2bead7d0fe3933a30a6c4/conan/packager.py#L406

Assuming pip == pip2, which it normally is

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
koliyocommented, Feb 3, 2018

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 using pip3, otherwise pip2. Maybe you need something like this to check if the those binares are available. If not, fall back to pip.

0reactions
theodelrieucommented, Nov 15, 2018

I’d like to get this feature as well 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found