
It's important to upgrade the version for Python 3 first, because the one you upgrade last will later be accessible through pip, which must be pip2 by default.Īs of pip version 10 (I think), the pip/ pip3 command is broken, due to a change in the package structure which is not compatible with the launch scripts provided from the python-pip/ python3-pip packages from apt. Note that I upgrade both pips for Python 2 and Python 3. Or you can upgrade it for your user only using the -user option: pip3 install -upgrade -user pip Once you've switched to a Pyenv version, you can run pip without sudo, and install/upgrade packages easily - without interfering with your system Python: pyenv global 3.7.You can either upgrade pip globally using sudo: sudo pip3 install -upgrade pip

To check which Python versions are available, run pyenv versions. If you want the “old” system python, run: pyenv global system This switches your python to point to 3.7.4. Now, you can choose your Python version: pyenv global 3.7.4

Instead, use a user-level Python distribution installed via pyenv. Here's my number one tip: Do not use sudo with pip. When I try to upgrade pip I'm getting above errors

While I was installing it asked me to upgrade pip. OSError: Permission denied: '/usr/local/lib/python2.7/dist-packages/pip' Self.move_wheel_files(self.source_dir, root=root, prefix=prefix)įile "/home/larz/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_filesįile "/home/larz/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_filesįile "/home/larz/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobberįile "/home/larz/.local/lib/python2.7/site-packages/pip/utils/_init_.py", line 83, in ensure_dirįile "/usr/lib/python2.7/os.py", line 157, in makedirs pip install -upgrade pipīut it won't upgrade it with the following error: **$ pip install -upgrade pip**įile "/home/larz/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in mainįile "/home/larz/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in runįile "/home/larz/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in installįile "/home/larz/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install I'm trying to upgrade pip into the newest version (old version 9.0.1 and newest version 19.3.1.
