Skip to content Skip to sidebar Skip to footer

Default Pip In Python Virtual Environment Is Ancient, How To Fix It?

I used python3 -m venv to create a virtual environment, in that virtual environment my settings are: python 3.5.2 pip 8.1.1 Mac OS 10.13.6 That pip version is extremely OLD and lea

Solution 1:

As of today, it is not possible.

Starting with Python 3.9 it should be possible to do something like path/to/pythonX.Y -m venv --upgrade-deps .venv, and that would upgrade pip and setuptools in the newly created virtual environment:

You could try virtualenv instead, if it suits your workflow better. As far as I know it tries to always install the latest version of pip in the virtual environments it creates.

There is an example of code at the end of venv's documentation showing how to create a tool that downloads and installs up-to-date pip and setuptools:

User wim made an interesting suggestion here:

I have a tool called ve that does something similar:

There are some answers to similar questions, suggesting to modify the wheel files bundled with ensurepip in Python's standard library, but I wouldn't recommend that.

Similar questions:

Post a Comment for "Default Pip In Python Virtual Environment Is Ancient, How To Fix It?"