问题:“ pip install unroll”:“ python setup.py egg_info”失败,错误代码为1
我是Python的新手,并一直在尝试使用安装某些软件包pip
。
但是pip install unroll
给我
命令“ python setup.py egg_info”在C:\ Users \ MARKAN〜1 \ AppData \ Local \ Temp \ pip-build-wa7uco0k \ unroll \中失败,错误代码为1
我该如何解决?
I’m new to Python and have been trying to install some packages with pip
.
But pip install unroll
gives me
Command “python setup.py egg_info” failed with error code 1 in
C:\Users\MARKAN~1\AppData\Local\Temp\pip-build-wa7uco0k\unroll\
How can I solve this?
回答 0
关于错误代码
根据Python文档:
该模块提供了可用的标准errno系统符号。每个符号的值是相应的整数值。名称和描述是从linux / include / errno.h借来的,应该十分全面。
错误代码1在errno.h
和中定义Operation not permitted
。
关于您的错误
您的setuptools似乎未安装。只需遵循Installation Instructions
PyPI网站上的即可。
如果已经安装,请尝试
pip install --upgrade setuptools
如果已经更新,请检查模块ez_setup是否缺失。如果是的话
pip install ez_setup
然后再试一次
pip install unroll
如果仍然无法正常运行,则可能是pip没有正确安装/升级setup_tools,因此您可能需要尝试
easy_install -U setuptools
然后再次
pip install unroll
About the error code
According to the Python documentation:
This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value. The names and descriptions are borrowed from linux/include/errno.h, which should be pretty all-inclusive.
Error code 1 is defined in errno.h
and means Operation not permitted
.
About your error
Your setuptools do not appear to be installed. Just follow the Installation Instructions
from the PyPI website.
If it’s already installed, try
pip install --upgrade setuptools
If it’s already up to date, check that the module ez_setup is not missing. If it is, then
pip install ez_setup
Then try again
pip install unroll
If it’s still not working, maybe pip didn’t install/upgrade setup_tools properly so you might want to try
easy_install -U setuptools
And again
pip install unroll
回答 1
这是一些指南,解释了我通常如何在Python + Windows上安装新软件包。看来您使用的是Windows路径,因此此答案将遵循特定的SO:
- 我从不使用系统范围的Python安装。我只使用virtualenvs,通常我会尝试使用最新版本的2.x和3.x。
- 我的第一次尝试总是
pip install package_i_want
在某些Visual Studio命令提示符下进行。什么Visual Studio命令提示符?好吧,理想情况下是与用来构建Python的Visual Studio相匹配的Visual Studio。例如,假设您的Python安装提示Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
。可以在此处找到用于编译Python的Visual Studio版本,因此v1500表示我将使用vs2008 x64命令提示符
- 如果上一步由于某种原因而失败,我只是尝试使用
easy_install package_i_want
- 如果上一步由于某种原因失败,我将转到gohlke网站,并检查我的包裹是否在那儿。如果是这样,我很幸运,我将其下载到virtualenv中,然后使用命令提示符转到该位置,然后执行
pip install package_i_want.whl
- 如果上一步没有成功,我将尝试自己制作轮子,一旦生成,我将尝试使用
pip install package_i_want.whl
现在,如果我们专注于您的特定问题,那么您将很难安装展开软件包。似乎最快的安装方式是执行以下操作:
git clone https://github.com/Zulko/unroll
cd unroll && python setup.py bdist_wheel
- 将创建的dist文件夹中生成的unroll-0.1.0-py2-none-any.whl文件复制到virtualenv中。
pip install unroll-0.1.0-py2-none-any.whl
这样,它将安装没有任何问题。要检查它是否确实有效,只需登录Python安装并尝试import unroll
,不要抱怨。
最后一点:这种方法几乎在99%的时间内都有效,有时您会发现一些特定于Unix或Mac OS X的pip程序包,在这种情况下,恐怕最好的方法是Windows版本正在向主要开发人员发布一些问题,或者您可以通过自己移植到Windows来获得一些乐趣(如果不走运,通常需要几个小时):)
Here’s a little guide explaining a little bit how I usually install new packages on Python + Windows. It seems you’re using Windows paths, so this answer will stick to that particular SO:
- I never use a system-wide Python installation. I only use virtualenvs, and usually I try to have the latest version of 2.x & 3.x.
- My first attempt is always doing
pip install package_i_want
in some of my Visual Studio command prompts. What Visual Studio command prompt? Well, ideally the Visual Studio which matches the one which was used to build Python. For instance, let’s say your Python installation says Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
. The version of Visual Studio used to compile Python can be found here, so v1500 means I’d be using vs2008 x64 command prompt
- If the previous step failed for some reason I just try using
easy_install package_i_want
- If the previous step failed for some reason I go to gohlke website and I check whether my package is available over there. If it’s so, I’m lucky, I just download it into my virtualenv and then I just go to that location using a command prompt and I do
pip install package_i_want.whl
- If the previous step didn’t succeed I’ll just try to build the wheel myself and once it’s generated I’ll try to install it with
pip install package_i_want.whl
Now, if we focus in your specific problem, where you’re having a hard time installing the unroll package. It seems the fastest way to install it is doing something like this:
git clone https://github.com/Zulko/unroll
cd unroll && python setup.py bdist_wheel
- Copy the generated unroll-0.1.0-py2-none-any.whl file from the created dist folder into your virtualenv.
pip install unroll-0.1.0-py2-none-any.whl
That way it will install without any problems. To check it really works, just login into the Python installation and try import unroll
, it shouldn’t complain.
One last note: This method works almost 99% of the time, and sometimes you’ll find some pip packages which are specific to Unix or Mac OS X, in that case, when that happens I’m afraid the best way to get a Windows version is either posting some issues to the main developers or having some fun by yourself porting to Windows (typically a few hours if you’re not lucky) :)
回答 2
升级点数后已解决:
python -m pip install --upgrade pip
pip install "package-name"
It was resolved after upgrading pip:
python -m pip install --upgrade pip
pip install "package-name"
回答 3
我完全陷入了与相同的错误psycopg2
。看来我在安装Python和相关软件包时跳过了几个步骤。
sudo apt-get install python-dev libpq-dev
- 转到您的虚拟环境
pip install psycopg2
(在您的情况下,您需要替换psycopg2
遇到问题的软件包。)
它无缝地工作。
I got stuck exactly with the same error with psycopg2
. It looks like I skipped a few steps while installing Python and related packages.
sudo apt-get install python-dev libpq-dev
- Go to your virtual env
pip install psycopg2
(In your case you need to replace psycopg2
with the package you have an issue with.)
It worked seamlessly.
回答 4
在安装我得到同样的错误mitmproxy
使用pip3
。下面的命令解决了这个问题:
pip3 install --upgrade setuptools
I got this same error while installing mitmproxy
using pip3
. The below command fixed this:
pip3 install --upgrade setuptools
回答 5
- 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 bit used
回答 6
另一种方式:
sudo apt-get install python-psycopg2 python-mysqldb
Other way:
sudo apt-get install python-psycopg2 python-mysqldb
回答 7
我有同样的问题。
问题是:
pyparsing 2.2
已经安装好了,我requirements.txt
正在尝试安装pyparsing 2.0.1
,抛出此错误
上下文:我使用的是virtualenv,似乎2.2来自我的全局操作系统Python site-packages
,但是即使带有--no-site-packages
标志(默认为上一个virtualenv中的默认标志),2.2仍然存在。肯定是因为我从他们的网站安装了Python,并将Python库添加到了我的$PATH
。
也许一个pip install --ignore-installed
会工作。
解决方案:因为我需要向前移动,我只是删除了pyparsing==2.0.1
从我的requirements.txt
。
I had the same problem.
The problem was:
pyparsing 2.2
was already installed and my requirements.txt
was trying to install pyparsing 2.0.1
which throw this error
Context: I was using virtualenv, and it seems the 2.2 came from my global OS Python site-packages
, but even with --no-site-packages
flag (now by default in last virtualenv) the 2.2 was still present. Surely because I installed Python from their website and it added Python libraries to my $PATH
.
Maybe a pip install --ignore-installed
would have worked.
Solution: as I needed to move forwards, I just removed the pyparsing==2.0.1
from my requirements.txt
.
回答 8
尝试使用pip安装Python模块时遇到了相同的错误代码。@Hackndo指出文档指出了安全问题。
基于该答案,我的问题通过运行带有sudo前缀的pip install命令得以解决:
sudo pip install python-mpd2
I ran into the same error code when trying to install a Python module with pip.
@Hackndo noted that the documentation indicate a security issue.
Based on that answer, my problem was solved by running the pip install command with sudo prefixed:
sudo pip install python-mpd2
回答 9
在安装“ Twisted”库时遇到了相同的问题,并通过在Ubuntu 16.04(Xenial Xerus)上运行以下命令解决了该问题:
sudo apt-get install python-setuptools python-dev build-essential
I had the same issue when installing the “Twisted” library and solved it by running the following command on Ubuntu 16.04 (Xenial Xerus):
sudo apt-get install python-setuptools python-dev build-essential
回答 10
我尝试了以上所有方法,但均未成功。然后,我将Python版本从2.7.10更新到2.7.13,它解决了我遇到的问题。
I tried all of the above with no success. I then updated my Python version from 2.7.10 to 2.7.13, and it resolved the problems that I was experiencing.
回答 11
That means some packages in pip are old or not correctly installed.
Try checking version and then upgrading pip.Use auto remove if that works.
If the pip command shows an error all the time for any command or it freezes, etc.
The best solution is to uninstall it or remove it completely.
Install a fresh pip and then update and upgrade your system.
I have given a solution to installing pip fresh here – python: can’t open file get-pip.py error 2] no such file or directory
回答 12
这对我来说是更简单的方法:
pip2 install Name
因此,如果您使用的是pip,请尝试使用pip3或pip2
它应该解决问题。
This was the easier way for me:
pip2 install Name
So if you was using pip, try to use pip3 or pip2
It should solve the problem.
回答 13
pip3 install –upgrade setuptools警告:pip正在由旧的脚本包装程序调用。这将在以后的pip版本中失败。请参阅https://github.com/pypa/pip/issues/5599,以获取有关解决基本问题的建议。
******为了避免此问题,您可以使用-m pip调用Python,而不是直接运行pip。******
使用python3 -m pip“命令”例如:python3 -m pip install –user pyqt5
pip3 install –upgrade setuptools
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
******To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.******
use python3 -m pip “command”
eg: python3 -m pip install –user pyqt5
回答 14
这为我工作:
sudo xcodebuild -license
This worked for me:
sudo xcodebuild -license
回答 15
将Python升级到版本3解决了我的问题。什么都没做。
Upgrading Python to version 3 fixed my problem. Nothing else did.
回答 16
I downloaded the .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and then did:
pip install scipy-0.19.1-cp27-cp27m-win32.whl
Note that the version you need to use (win32/win_amd-64) depends on the version of Python and not that of Windows.
回答 17
回答 18
我在使用相同的错误消息时遇到了同样的问题,但是在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
成功运行。
I faced the same problem with the same error message but on Ubuntu 16.04 LTS (Xenial Xerus) instead:
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-w71uo1rg/poster/
I tested all the solutions provided above and none of them worked for me. I read the full TraceBack and found out I had to create the virtual environment with Python version 2.7 instead (the default one uses Python 3.5 instead):
virtualenv --python=/usr/bin/python2.7 my_venv
Once I activated it, I run pip install unirest
successfully.
回答 19
尝试在Linux上:
sudo apt install python-pip python-bluez libbluetooth-dev libboost-python-dev libboost-thread-dev libglib2.0-dev bluez bluez-hcidump
try on linux:
sudo apt install python-pip python-bluez libbluetooth-dev libboost-python-dev libboost-thread-dev libglib2.0-dev bluez bluez-hcidump
回答 20
我使用以下方法在Centos 7上解决了该问题:
sudo yum install libcurl-devel
I solved it on Centos 7 by using:
sudo yum install libcurl-devel
回答 21
我的Win10 PC上使用不同的软件包时遇到了相同的问题,并尝试了到目前为止提到的所有内容。
最后通过禁用Comodo Auto-Containment解决了该问题。
由于没有人提及它,我希望它能对某人有所帮助。
Had the same problem on my Win10 PC with different packages and tried everything mentioned so far.
Finally solved it by disabling Comodo Auto-Containment.
Since nobody has mentioned it yet, I hope it helps someone.
回答 22
I had the same problem and was able to fix by doing the following.
Windows Python needs Visual C++ libraries installed via the SDK to build code, such as via setuptools.extension.Extension or numpy.distutils.core.Extension. For example, building f2py modules in Windows with Python requires Visual C++ SDK as installed above. On Linux and Mac, the C++ libraries are installed with the compiler.
https://www.scivision.co/python-windows-visual-c++-14-required/
回答 23
以下命令对我有用
[root@sandbox ~]# pip install google-api-python-client==1.6.4
Following below command worked for me
[root@sandbox ~]# pip install google-api-python-client==1.6.4
回答 24
更新setuptools时解决setup.pu egg_info问题的方法或其他方法不起作用。
- 如果CONDA可以安装版本的库,请使用conda而不是pip。
- 克隆库回购,然后尝试通过
pip install -e .
或通过进行安装python setup.py install
Methods to solve setup.pu egg_info issue when updating setuptools or not other methods doesnot works.
- If CONDA version of the library is available to install use conda instead of pip.
- Clone the library repo and then try installation by
pip install -e .
or by python setup.py install