C
C
cicwak2020-11-20 00:55:37
ubuntu
cicwak, 2020-11-20 00:55:37

PIP is not updated, PermissionError, who knows how to solve?

I tried to update PIP version 8.1.1 to 20.2.4, an error got out, please help who knows the solutions to this, I already climbed the forums, but it still does not update, thanks in advance
5fb6e9791dd5f250803501.png
'''
(venv) [email protected]:~/DB_PDD$ python - m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/cb/28/91f2...
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1 :
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.5/shutil.py", line 538, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/home/kostya/venv/lib/python3.5/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst' -> '/tmp/pip-59b6n9nv -uninstall/home/kostya/venv/lib/python3.5/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst'

During handling of the above exception, another exception occurred:

Traceback (most recent call last ):
File "/home/kostya/venv/lib/python3.5/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/home/kostya/ venv/lib/python3.5/site-packages/pip/commands/install.py", line 335, in run
prefix=options.prefix_path,
File "/home/kostya/venv/lib/python3.5/site-packages /pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/home/kostya/venv/lib/python3.5/site-packages/pip/req/req_install.py", line 747, in uninstall
paths_to_remove.remove(auto_confirm)
File "/ home/kostya/venv/lib/python3.5/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/home/kostya/venv/lib/python3.5 /site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python3.5/shutil.py", line 553, in move
os. unlink(src)
PermissionError: [Errno 13] Permission denied: '/home/kostya/venv/lib/python3.5/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst'
You are using pip version 8.1.1, however version 20.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) [email protected]:~/DB_PDD$ sudo python -m pip install --upgrade pip
/usr/bin/python: No module named pip
(venv) [email protected]:~/DB_PDD$ python -m pip install -- upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/cb/28/91f2...
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Exception:
Traceback ( most recent call last):
File "/usr/lib/python3.5/shutil.py", line 538, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/home/kostya/venv/lib/python3.5/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst' -> '/tmp/pip-z0i63h0t -uninstall/home/kostya/venv/lib/python3.5/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst'

During handling of the above exception, another exception occurred:

Traceback (most recent call last ):
File "/home/kostya/venv/lib/python3.5/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/home/kostya/ venv/lib/python3.5/site-packages/pip/commands/install.py", line 335, in run
prefix=options.prefix_path,
File "/home/kostya/venv/lib/python3.5/site-packages /pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/home/kostya/venv/lib/python3.5/site-packages/pip/req/req_install.py", line 747, in uninstall
paths_to_remove.remove(auto_confirm)
File "/ home/kostya/venv/lib/python3.5/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/home/kostya/venv/lib/python3.5 /site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python3.5/shutil.py", line 553, in move
os. unlink(src)
PermissionError: [Errno 13] Permission denied: '/home/kostya/venv/lib/python3.5/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst'
'''

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vreitech, 2020-11-20
@cicwak

Execute first sudo chown -R kostya ~kostya/.
Then pip install --upgrade pip. Or maybe even instead python -m pip install --upgrade pip.

V
Valdemar Smorman, 2020-11-20
@smorman

Mono from here:
pip 20.2.4 documentation
Installing with get-pip.py

cd /tmp; wget https://bootstrap.pypa.io/get-pip.py; cd

или

cd /tmp; curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py; cd

get-pip.py also installs setuptools and wheel if they are not already. setuptools is required to install source distributions. Both are required in order to build a Wheel Cache (which improves installation speed), although neither are required to install pre-built wheels.
If these - setuptools and wheel are not needed, then use the options in the installation command above python get-pip.py:
get-pip.py options
--no-setuptools
--no-wheel

For example:
python get-pip.py --no-setuptools
And most likely, so that there are no errors, and if there is a User, then add sudo
mono to the installation command A and from here:
Get pip
$ # Install the latest version of pip
$ curl https://bootstrap.pypa.io/get-pip.py | python
$ # Install the latest version of pip, supported by a legacy Python
$ curl https://bootstrap.pypa.io/3.2/get-pip.py | python3.2
$ # Install a specific version of pip
$ curl https://bootstrap.pypa.io/get-pip.py | python - 'pip==8.0.0'

or
cd /tmp; wget https://bootstrap.pypa.io/get-pip.py; sudo  python get-pip.py; cd

If installing from the Package Manager, then:
sudo apt install python-pip
and updating:
pip install -U pip
Again, if there is a User, then through sudo at the beginning...

A
alexbprofit, 2021-04-03
@alexbprofit

Even easier:
pip install -U --user pip

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question