GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
The equivalent shell script I use is following:
# Updates setuptools and pip n a virtualenv
rm ez_setup.py get-pip.py setuptools-*.tar.gz
Why can you not just do:
foo/bin/pip install -U setuptools
# or if you want the latest versions of both
# foo/bin/python -m pip install -U setuptools pip
Having said this, an option to install the latest versions isn't out of the question.
Why different syntax when upgrading both – -m pip instead of pip?
Because pip can't replace its own wrapper executable while it's running. That's certainly true on Windows, and may or may not be on Unix.
I use the guaranteed-reliable form python -m pip just to make sure the advice I give doesn't cause problems to anyone who might find this thread in future.
python -m pip
Stackoverflow question: Does Python IO allow opened file to be deleted/renamed on Windows?
Python issue 12939: Add new io.FileIO using the native Windows API
Executable wrappers and upgrading pip (Was: Current status of PEP 439 (pip boostrapping))
Not relevant, it's the OS that opens the pip.exe file and it doesn't allow removal. This has been discussed extensively on the distutils-sig list. Feel free to look there and if you can provide an implementation strategy (preferably in the form of a patch :-)) that might work, that would be fantastic.
Having said that, this is a bit off topic for this feature request.