Я только что получил новый macbook под MacOS 10.14.1 и пытаюсь установить pip. Я нахожусь на учетной записи администратора. При попытке установить pip я получаю сообщение об ошибке ниже.
До этого я sudo установил pip через sudo easy_install pip
, но начал читать, что это потенциально опасно, так же, как и sudo uninstall pip
.
Были и другие ответы ( pip не может правильно установить пакеты: ошибка доступа запрещена ), исследуя решение, но меня больше интересует почему У меня нет разрешения на эту папку и устранение основной причины. После чрезмерного поиска в Google в течение последнего часа я собираюсь выполнить чистую установку, так как установка pip через sudo может быть связана с корневыми пакетами.
➜ ~ easy_install pip
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-60057.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again.
Обратите внимание, я также получаю эту ошибку при попытке установить pip напрямую.
➜ ~ python get-pip.py
Collecting pip
Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 9.7MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.