How to upgrade pip3?
I want to use python3.5 to develop basically, but many times when I install the module for the python 3.5, it always failed. And the terminal told me that higher version is available, it did not work when I upgrade it.
You are using pip3 to install flask-script which is associated with python 3.5. However, you are trying to upgrade pip associated with the python 2.7, try running pip3 install --upgrade pip.
It might be a good idea to take some time and read about virtual environments in Python. It isn't a best practice to install all of your packages to the base python installation. This would be a good start: http://docs.python-guide.org/en/latest/dev/virtualenvs/
Try running sudo -H pip3 install --upgrade pip to upgrade your pip3. Conversely, you can do sudo -H pip2 install --upgrade pip to upgrade pip as well.
Try this command:
pip3 install --upgrade setuptools pip
You use pip (the Python 2 one). Now you want to upgrade pip (the Python 3 one). After that, pip is the Python 3 one.
Use pip2 and pip3. This way it is explicit.
If you want to use pip, just check where it is (which pip) and change the link. For example:
$ which pip /usr/local/bin/pip $ pip --version pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5) $ which pip2 /usr/local/bin/pip2 $ sudo rm /usr/local/bin/pip $ sudo ln -s /usr/local/bin/pip2 /usr/local/bin/pip $ pip --version pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
What worked for me was the following command:
python -m pip install --upgrade pip
If you have 2 versions of Python (eg: 2.7.x and 3.6), you need do:
- add the path of 2.x to system PATH
- add the path of 3.x to system PATH
- pip3 install --upgrade pip setuptools wheel
for example, in my .zshrc file:
You can exec command pip --version and pip3 --version check the pip from the special version. Because if don't add Python path to $PATH, and exec pip3 install --upgrade pip setuptools wheel, your pip will be changed to pip from python3, but the pip should from python2.x
pip3 install --upgrade pip worked for me