pip开发安装失败,并显示EnvironmentError,缺少easy_install.py吗?

时间:2020-03-23 20:30:13

标签: python-3.x macos pip easy-install

我正在尝试在开发模式下本地安装软件包。运行install命令时,出现以下错误:

>> pip install -e .
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///Users/myuser/repos/pgcli
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/myuser/virtual_envs/pgcli/usr/local/bin/python /Library/Python/3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/n3/sgkb54ts5714xp2plx4xm_x80000gn/T/pip-build-env-z2i4jg2h/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
   cwd: None
  Complete output (8 lines):
  Collecting setuptools>=40.8.0
Using cached setuptools-46.1.1-py3-none-any.whl (582 kB)
  Collecting wheel
Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
  Installing collected packages: setuptools, wheel
  ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.7/site-packages/easy_install.py'
  Consider using the `--user` option or check the permissions.

  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/myuser/virtual_envs/pgcli/usr/local/bin/python /Library/Python/3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/n3/sgkb54ts5714xp2plx4xm_x80000gn/T/pip-build-env-z2i4jg2h/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

需要注意的几件事:

  • 输出的第一行指出pip默认为用户安装,因此添加--user不应(实际上也不会)进行任何更改。
  • “权限被拒绝”错误中引用的easy_install脚本实际上不存在。

我确实有easy_install,但是它不在指定的位置:

>> ls /Library/Python/3.7/site-packages/easy*
ls: /Library/Python/3.7/site-packages/easy*: No such file or directory

>> file "$(which easy_install)"
/Users/myuser/virtual_envs/pgcli/usr/local/bin/easy_install: a /Users/myuser/virtual_envs/pgcli/usr/local/bin/python script text executable, ASCII text

>> deactivate

>> which easy_install
/usr/bin/easy_install

我想念什么?我该如何工作?


其他信息:

  • python 3.7
  • 点20.0.2
  • 我正在安装的软件包是github.com/dbcli/pgcli(我认为这不是软件包的问题)
  • 使用virtualenv
  • 在MacOS Catalina 10.15.3上

0 个答案:

没有答案