Default Pip In Python Virtual Environment Is Ancient, How To Fix It?
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:
- https://bugs.python.org/issue34556
- https://github.com/python/cpython/pull/13100
- https://docs.python.org/3.9/library/venv.html
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?"