我正在尝试用pip安装一些软件包。

但pip安装展开给我

命令“python setup.py egg_info”失败,错误码为1 C:\Users\马可的~ 1 \ AppData \ \ Temp \ pip-build-wa7uco0k \展开\

我怎么解决这个问题?


当前回答

我在Ubuntu 16.04 LTS (Xenial Xerus)上遇到了同样的问题和同样的错误消息:

命令“python setup.py egg_info”在/tmp/pip-install-w71uo1rg/poster/目录下失败,错误码为1

我测试了上面提供的所有解决方案,没有一个适合我。我阅读了完整的TraceBack,发现我必须用Python 2.7版本来创建虚拟环境(默认使用Python 3.5):

virtualenv --python=/usr/bin/python2.7 my_venv

一旦我激活它,我成功地运行pip install unirest。

其他回答

我在使用pip3安装mitmproxy时遇到了同样的错误。下面的命令修复了这个问题:

pip3 install --upgrade setuptools

我刚刚在尝试pip install -e时遇到了同样的问题。新的回购。我没有注意到setup.py的内容没有被正确保存,我有效地运行了一个空的setup.py命令。

因此,如果目标包的setup.py为空或格式不正确,您可能会遇到相同的错误消息。

将Python升级到版本3解决了我的问题。其他的都没用。

Download and install the Microsoft Visual C++ Compiler for Python 2.7 from https://www.microsoft.com/en-in/download/details.aspx?id=44266 - this package contains the compiler and set of system headers necessary for producing binary wheels for Python 2.7 packages. Open a command prompt in elevated mode (run as administrator) Firstly do pip install ez_setup Then do pip install unroll (It will start installing numpy, music21, decorator, imageio, tqdm, moviepy, unroll) # Please be patient for music21 installation

Python 2.7.11使用64位

我在安装“Twisted”库时也遇到了同样的问题,在Ubuntu 16.04 (Xenial Xerus)上运行以下命令解决了这个问题:

sudo apt-get install python-setuptools python-dev build-essential