Как остановить мой терминал по умолчанию для старого Python 2.7.10 для установки Pyperclip? - PullRequest
0 голосов
/ 21 июня 2019

Я пытаюсь установить Pyperclip с Pip, но получаю предупреждение о том, что «Python 2.7 завершит свою работу 1 января 2020 года».и говорит мне, чтобы обновить.После этого я получаю кучу ошибок при установке.

У меня установлены Python 2.7.10 и 3.7.3 в моей системе.

Когда я запускаю pip install pyperclip, я получаю ошибку:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pyperclip
  Using cached 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
    ERROR: Complete output from command /usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/b5/yshbmh_d1352tytvt1r95hwr0000gn/T/pip-install-EKTm69/pyperclip/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b5/yshbmh_d1352tytvt1r95hwr0000gn/T/pip-record-ntOrdw/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/pyperclip
    copying src/pyperclip/__init__.py -> build/lib/pyperclip
    copying src/pyperclip/__main__.py -> build/lib/pyperclip
    running install_lib
    creating /Library/Python/2.7/site-packages/pyperclip
    error: could not create '/Library/Python/2.7/site-packages/pyperclip': Permission denied
    ----------------------------------------
ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/b5/yshbmh_d1352tytvt1r95hwr0000gn/T/pip-install-EKTm69/pyperclip/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b5/yshbmh_d1352tytvt1r95hwr0000gn/T/pip-record-ntOrdw/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/b5/yshbmh_d1352tytvt1r95hwr0000gn/T/pip-install-EKTm69/pyperclip/

Я ожидаю, что Pyperclip будет установлен правильно.

Ответы [ 2 ]

0 голосов
/ 21 июня 2019

Вам может понадобиться вызвать pip3 вместо pip

0 голосов
/ 21 июня 2019
try to add a sudo before pip install otherwise you can create virtual env in witch you can install your requirement without having issues

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...