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

但pip安装展开给我

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

我怎么解决这个问题?


当前回答

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位

其他回答

对我来说这很有效

python3 -m pip3 install -U pip

你也可以试试

python -m pip install -U pip

我在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

我在psycopg2上遇到了同样的错误。看起来我在安装Python和相关包时跳过了几个步骤。

Sudo apt-get install python-dev libpq-dev 进入你的虚拟环境 PIP安装psycopg2

(在您的情况下,您需要用有问题的包替换psycopg2。)

它工作得天衣无缝。

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位