“ pip install unroll”:“ python setup.py egg_info”失败,错误代码为1

本文翻译自:“pip install unroll”: “python setup.py egg_info” failed with error code 1

I'm new to Python and have been trying to install some packages with pip . 我是Python的新手,一直在尝试使用pip安装一些软件包。

But pip install unroll gives me 但是pip install unroll给了我

Command "python setup.py egg_info" failed with error code 1 in C:\\Users\\MARKAN~1\\AppData\\Local\\Temp\\pip-build-wa7uco0k\\unroll\\ 命令“ python setup.py egg_info”在C:\\ Users \\ MARKAN〜1 \\ AppData \\ Local \\ Temp \\ pip-build-wa7uco0k \\ unroll \\中失败,错误代码为1

How can I solve this? 我该如何解决?


#1楼

参考:https://stackoom.com/question/2R10V/pip-install-unroll-python-setup-py-egg-info-失败-错误代码为


#2楼

About the error code 关于错误代码

According to the Python documentation : 根据Python文档

This module makes available standard errno system symbols. 该模块提供了可用的标准errno系统符号。 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. 名称和描述是从linux / include / errno.h借来的 ,应该十分全面。

Error code 1 is defined in errno.h and means Operation not permitted . 错误代码1在errno.h定义,表示Operation not permitted

About your error 关于您的错误

Your setuptools do not appear to be installed. 您的setuptools似乎未安装。 Just follow the Installation Instructions from the PyPI website. 只需按照PyPI网站上的Installation Instructions

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. 如果已经更新,请检查模块ez_setup是否缺失。 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 如果仍然无法使用,则可能是pip没有正确安装/升级setup_tools,因此您可能需要尝试

easy_install -U setuptools

And again 然后再次

pip install unroll

#3楼

Here's a little guide explaining a little bit how I usually install new packages on Python + Windows. 这是一些指南,解释了我通常如何在Python + Windows上安装新软件包。 It seems you're using Windows paths, so this answer will stick to that particular SO: 似乎您正在使用Windows路径,因此此答案将遵循特定的SO:

  • I never use a system-wide Python installation. 我从不使用系统范围的Python安装。 I only use virtualenvs, and usually I try to have the latest version of 2.x & 3.x. 我只使用virtualenvs,通常我会尝试使用最新版本的2.x和3.x。
  • My first attempt is always doing pip install package_i_want in some of my Visual Studio command prompts. 我的第一个尝试总是在某些Visual Studio命令提示符中执行pip install package_i_want What Visual Studio command prompt? 什么Visual Studio命令提示符? Well, ideally the Visual Studio which matches the one which was used to build Python. 好吧,理想情况下是与用来构建Python的Visual Studio相匹配的Visual Studio。 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 . 例如,假设您的Python安装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 可以在这里找到用于编译Python的Visual Studio版本,因此v1500表示我将使用vs2008 x64命令提示符
  • If the previous step failed for some reason I just try using easy_install package_i_want 如果上一步由于某种原因而失败,我只是尝试使用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. 如果上一步由于某种原因失败了,请访问gohlke网站,然后检查我的包裹是否在那儿。 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 如果是这样,我很幸运,我将其下载到virtualenv中,然后使用命令提示符转到该位置,然后执行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 如果上一步没有成功,我将尝试自己构建轮子,一旦生成,我将尝试使用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. 将创建的dist文件夹中生成的unroll-0.1.0-py2-none-any.whl文件复制到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. 要检查它是否真的有效,只需登录Python安装并尝试import unroll ,它就不会抱怨。

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) :) 最后一点:此方法几乎在99%的时间内都有效,有时您会发现一些特定于Unix或Mac OS X的pip程序包,在这种情况下,恐怕最好的方法是Windows版本正在向主要开发人员发布一些问题,或者是您自己移植到Windows上获得了一些乐趣(如果不走运,通常需要几个小时):)


#4楼

  • 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. https://www.microsoft.com/zh-cn/download/details.aspx?id=44266下载并安装Microsoft Visual C++ Compiler for Python 2.7Microsoft Visual C++ Compiler for Python 2.7 -此程序包包含生成二进制文件所必需的编译器和系统标头集适用于Python 2.7软件包的轮子。
  • Open a command prompt in elevated mode (run as administrator) 在提升模式下打开命令提示符(以管理员身份运行)
  • Firstly do pip install ez_setup 首先做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 然后做pip install unroll (它将开始安装numpy, music21, decorator, imageio, tqdm, moviepy, unroll )#请耐心安装music21

Python 2.7.11 64 bit used 使用python 2.7.11 64位


#5楼

另一种方式:

sudo apt-get install python-psycopg2 python-mysqldb

#6楼

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. 然后,我将Python版本从2.7.10更新到2.7.13,它解决了我遇到的问题。

### 回答1: 这个问题可能是由于pip安装包的过程中,依赖的Python包没有正确安装所导致的。您可以尝试以下几种方法: 1. 更新pip:运行以下命令:pip install --upgrade pip 2. 检查Python环境是否正常:检查Python版本是否正确,以及Python环境变量是否配置正确。 3. 检查Python包的依赖关系:查看您安装的包是否需要其他包的支持。如果需要,请先安装这些包。 4. 检查安装包的来源:检查您安装的包是否来自可信的源,如PyPI。如果不是,请使用其他可信的源安装。 如果以上方法都无法解决问题,建议您提供更详细的错误信息,以便更好地了解问题所在,并尝试其他解决方案。 ### 回答2: 当运行"pip install"命令时,报错"python setup.py egg_info did not run successfully"通常是由于以下几个原因导致的: 1. 缺少依赖项:某些包可能依赖于其他软件包或者库。在运行"pip install"之前,需确保所有依赖项已经安装。通过查阅软件包的文档或在官方网站上查找所需的依赖项,并在安装之前手动安装这些依赖项。 2. 网络问题:有时可能由于网络连接问题,导致无法下载或安装包。请确保网络连接正常,并尝试重新运行"pip install"命令。 3. 权限问题:如果在安装过程中缺少适当的权限,可能导致报错。请确保当前用户具有足够的权限来安装软件包。在Windows系统上,可以尝试使用管理员权限运行命令提示符或者PowerShell。在Linux或Mac系统上,可以尝试在命令前加上sudo。 4. 包已被弃用:有时,所尝试安装的包可能已经被弃用或不再维护。可以在官方网站或官方软件包源码页面上查找更多信息,以确定是否需要更换其他包或选择使用不同的版本。 如果以上方法都无效,可以尝试通过更新pippython或者操作系统来解决问题。 ### 回答3: 当运行`pip install`命令时,报错`python setup.py egg_info did not run successfully`通常表示无法成功运行相关的`egg_info`脚本。这种情况可能出现在以下几种情况下: 1. 缺少依赖项:某些Python库在安装前可能需要先安装一些依赖库。如果您没有安装这些依赖库,或者版本不兼容,`egg_info`脚本可能无法成功运行。您可以在错误消息中查看提到的缺失依赖项,并尝试手动安装它们。 2. Python版本问题:某些库可能只在特定版本的Python中才能正常工作。如果您正在使用不兼容的Python版本,`egg_info`脚本可能无法运行。您可以通过检查库的官方文档或README文件,查看支持的Python版本。 3. 源问题:有时,pip包管理器可能无法从默认源中正确下载或安装软件包。您可以尝试更换pip的源为国内源如豆瓣源或清华源,以避免下载问题。 解决这个问题的方法可以尝试以下几种: 1. 确保已正确安装所有依赖库,并保持其版本兼容性。 2. 检查所使用的Python版本是否与库的要求兼容,如果不兼容,则可以尝试切换到兼容的Python版本。 3. 尝试更换pip源,可以使用`-i`选项指定其他源,比如使用豆瓣源:`pip install -i https://pypi.doubanio.com/simple <package_name>`。 4. 如果以上方法都不起作用,您还可以尝试手动下载软件包文件(.whl或.tar.gz),然后使用`pip install`命令指定本地文件路径进行安装。 通过以上的方法,您应该能够解决`python setup.py egg_info did not run successfully`的报错问题。如果问题仍然存在,建议查看错误消息中的详细信息,以便更准确地确定问题所在。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值