【发布时间】:2021-11-16 03:18:03
【问题描述】:
我有一个软件包,我已经在其他机器上安装了很多次,但在我的 Mac 上我遇到了一个奇怪的错误。我曾尝试在 conda 环境和虚拟环境中执行此操作,但总是在下面遇到相同的错误。
注意:
- 我可以毫无问题地打开 python shell 并导入 setuptools。
- 无需 -e 即可安装
- 它列出的失败的命令我可以手动运行。
- 我已经通过 pip 升级了 setuptools
/Users/eric/Library/Caches/pypoetry/virtualenvs/mypkg-3XmClfyY-py3.9/bin/pip install -e ~/Documents/MyDir/repo/mypkg
Obtaining file:///Users/eric/Documents/MyDir/repo/mypkg
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: loguru<0.6.0,>=0.5.3 in /Users/eric/Library/Caches/pypoetry/virtualenvs/mypkg-3XmClfyY-py3.9/lib/python3.9/site-packages (from mypkg==0.1.0) (0.5.3)
Installing collected packages: mypkg
Running setup.py develop for mypkg
ERROR: Command errored out with exit status 1:
command: /Users/eric/Library/Caches/pypoetry/virtualenvs/mypkg-3XmClfyY-py3.9/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/eric/Documents/MyDir/repo/mypkg/setup.py'"'"'; __file__='"'"'/Users/eric/Documents/MyDir/repo/mypkg/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: /Users/eric/Documents/MyDir/repo/mypkg/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
import io, os, sys, setuptools, tokenize; sys.argv[0] = '/Users/eric/Documents/MyDir/repo/mypkg/setup.py'; __file__='/Users/eric/Documents/MyDir/repo/mypkg/setup.py';f = getattr(tokenize, 'open', open)(__file__) if os.path.exists(__file__) else io.StringIO('from setuptools import setup; setup()');code = f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))
│ │ └ <module 'io' from '/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/io.py'>
│ └ <module 'os' from '/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py'>
└ <module 'sys' (built-in)>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/eric/Library/Caches/pypoetry/virtualenvs/mypkg-3XmClfyY-py3.9/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/eric/Documents/MyDir/repo/mypkg/setup.py'"'"'; __file__='"'"'/Users/eric/Documents/MyDir/repo/mypkg/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
【问题讨论】:
-
pip uninstall setuptools? -
你在虚拟环境中安装了pip吗
标签: python pip setuptools