Изучаю pyyhon 3, для работы с буфером памяти в задании требуется установить piperclip, выполняю через командную строку.
Не получается, обновить pip до последней версии тоже не получается.
Microsoft Windows
© Корпорация Майкрософт (Microsoft Corporation), 2019. Все права защищены.
C:\Users\я>pip install pyperclip
Collecting pyperclip
Downloading https://files.pythonhosted.org/packages/2d/0f/4eda562dffd085945d57c2d9a5da745cfb5228c02bc90f2c74bbac746243/pyperclip-1.7.0.tar.gz
Installing collected packages: pyperclip
Running setup.py install for pyperclip … error
Exception:
Traceback (most recent call last):
File “c:\program files\python36\lib\site-packages\pip\compat\__init__.py”, line 73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: ‘utf-8’ codec can't decode byte 0xce in position 81: invalid continuation byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “c:\program files\python36\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “c:\program files\python36\lib\site-packages\pip\commands\install.py”, line 342, in run
prefix=options.prefix_path,
File “c:\program files\python36\lib\site-packages\pip\req\req_set.py”, line 784, in install
**kwargs
File “c:\program files\python36\lib\site-packages\pip\req\req_install.py”, line 878, in install
spinner=spinner,
File “c:\program files\python36\lib\site-packages\pip\utils\__init__.py”, line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File “c:\program files\python36\lib\site-packages\pip\compat\__init__.py”, line 75, in console_to_str
return s.decode('utf_8')
UnicodeDecodeError: ‘utf-8’ codec can't decode byte 0xce in position 81: invalid continuation byte
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.
C:\Users\я>python -m pip install –upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 530kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
File “C:\Program Files\Python36\lib\shutil.py”, line 538, in move
os.rename(src, real_dst)
PermissionError: Отказано в доступе: ‘c:\\program files\\python36\\lib\\site-packages\\pip-9.0.1.dist-info\\description.rst’ -> ‘C:\\Users\\E0F1~1\\AppData\\Local\\Temp\\pip-26uz5vv9-uninstall\\program files\\python36\\lib\\site-packages\\pip-9.0.1.dist-info\\description.rst’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Program Files\Python36\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “C:\Program Files\Python36\lib\site-packages\pip\commands\install.py”, line 342, in run
prefix=options.prefix_path,
File “C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File “C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File “C:\Program Files\Python36\lib\site-packages\pip\req\req_uninstall.py”, line 115, in remove
renames(path, new_path)
File “C:\Program Files\Python36\lib\site-packages\pip\utils\__init__.py”, line 267, in renames
shutil.move(old, new)
File “C:\Program Files\Python36\lib\shutil.py”, line 553, in move
os.unlink(src)
PermissionError: Отказано в доступе: ‘c:\\program files\\python36\\lib\\site-packages\\pip-9.0.1.dist-info\\description.rst’
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.
Догадался что дело в переменной окружения, прописал в Path путь до python.exe
Теперь сообщение
Microsoft Windows
© Корпорация Майкрософт (Microsoft Corporation), 2019. Все права защищены.
C:\Users\я>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> pip install piperclip
File “<stdin>”, line 1
pip install piperclip
^
SyntaxError: invalid syntax
>>>