2

My system pip is install in /opt/.../site-packages. It is versio 1.5.6. In a new virtualenv I run pip install -U pip. I see:

...Downloading pip-18.0-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.6
Not uninstalling pip at /opt/site-packages, outside environment /home/venv
Successfully installed pip
Cleaning up...
 Removing temporary dir /home/venv/build...

But pip -V now still says pip 1.5.6 from /opt/.../site-packages

Both pip and pip2 present in the venv/bin dir show the same. which pip points to the pip in the venv/bin path, so it looks like that pip bin is just never being updated. How do I use the new pip I just installed in my virtual environment?

3 Answers 3

2

Solution was (virtualenv):easy_install -U pip

Sign up to request clarification or add additional context in comments.

Comments

0

Seems that virtualenv is preventing you to access any module outside the virtual environment home. If you want to upgrade your system pip, do it from outside the virtual environment. Anyway when upgrading pip it's better not to call the binary itself. Try this in your virtualenv:

 python -m pip install --upgrade pip

7 Comments

I can't upgrade my system pip. I wanted to have a new version installed in my virtualenv and use that when the venv is activated.
Running the command inside your virtualenv should do the trick
No dice. pip -V still gives pip 1.5.6 from my system dir
Do you want to use the pip version in your virtualenv from outside your virtualenv???
No. I want to use it in the virtualenv. I'm in the virtualenv running the upgrade and -V commands.
|
0

The problem is that when you create your virtual environment, it will use the packages bundled with that version. If you install a new version of virtualenv you will need to re-create the environment to make use of the new package bundle.

Other alternatives are to manually upgrade the packages within the virtual environment.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.