Pip is not updated?

When trying to install PyAutoGui , I have an error that says that I need to update pip ,when trying to update error appears
pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/0f/74/ecd1...
Installing collected packages: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "/home/genios/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/genios/.local/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/genios/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/genios/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/genios/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/genios/.local/lib/python3.5/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/genios/.local/lib/python3.5/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] access is Denied: '/usr/local/lib/python3.5/dist-packages/pip/__init__.py'
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

What do I do?
June 3rd 19 at 19:35
3 answers
June 3rd 19 at 19:37
Apparently to run the command like this:
sudo pip install --upgrade pip
As said the Russian language:
PermissionError: [Errno 13] access is Denied:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in
from pip._internal import main
ImportError: No module named 'pip._internal' - Ansley_Lesch62 commented on June 3rd 19 at 19:40
,
sudo python3 -m pip install --upgrade pip
or
sudo python-m pip install --upgrade pip
depending on the version of Python, I when it with a similar error helped - alia98 commented on June 3rd 19 at 19:43
thanks for the help - Ansley_Lesch62 commented on June 3rd 19 at 19:46
June 3rd 19 at 19:39
sudo python-m pip install --upgrade pip
June 3rd 19 at 19:41
Use venv, or you can do sudo pip install ...

Find more questions by tags Python