简体   繁体   English

嵌入式 Python 3.5“python setup.py egg_info”失败,错误代码为 1

[英]Embedded Python 3.5 “python setup.py egg_info” failed with error code 1

I am attempting to "pip install" PyAutoGUI ( among other modules ) and I am getting the following error :我正在尝试“pip install”PyAutoGUI(在其他模块中),但出现以下错误:

Collecting pyautogui
  Using cached PyAutoGUI-0.9.35.zip
  Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\PyAutoGUI.egg-info
writing top-level names to pip-egg-info\PyAutoGUI.egg-info\top_level.txt
writing requirements to pip-egg-info\PyAutoGUI.egg-info\requires.txt
writing pip-egg-info\PyAutoGUI.egg-info\PKG-INFO
writing dependency_links to pip-egg-info\PyAutoGUI.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\PyAutoGUI.egg-info\SOURCES.txt'
error: [Errno 2] No such file or directory: 'C:\\Users\\myDir\\Downloads\\python-3.5.0-embed-win32\\python35.zip\\lib2to3\\Grammar.txt'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in         C:\Users\myDir\AppData\Local\Temp\pip-build-aqcbpbui\pyautogui\

This is being done on a Windows 10 Professional without admin rights ( hence the embedded method of using Python 3.5 ).这是在没有管理员权限的 Windows 10 Professional 上完成的(因此是使用 Python 3.5 的嵌入式方法)。 I was able to pip install openpyxl without issue but when running the same command ( python -m pip install pyautogui ) I get the described error message and traceback found above.我能够毫无问题地 pip install openpyxl 但是当运行相同的命令( python -m pip install pyautogui )时,我得到了上面描述的错误消息和回溯。 I've done clean extractions of the zip and found the same problem.我已经完成了 zip 的干净提取并发现了同样的问题。

I searched through SO and only found questions that related to Mac environments and a single instance where the OS wasn't listed ( "python setup.py egg_info" failed with error code 1 ) which yielded no positive results ( actually ended up getting a different error message with the second suggested step...but...one issue at a time :P )我搜索了 SO,只找到了与 Mac 环境相关的问题和一个没有列出操作系统的实例( “python setup.py egg_info” failed with error code 1 ),没有产生任何积极的结果(实际上最终得到了一个不同的第二个建议步骤的错误消息......但是......一次一个问题:P)

I've confirmed that the file in question (( 'C:\\Users\\myDir\\Downloads\\python-3.5.0-embed-win32\\python35.zip\\lib2to3\\Grammar.txt' )) exists and even unzipped the directory just to be sure ( leaving the zip there as well intact to keep myself covered ).我已经确认有问题的文件 (( 'C:\\Users\\myDir\\Downloads\\python-3.5.0-embed-win32\\python35.zip\\lib2to3\\Grammar.txt' )) 存在,甚至只是解压了目录可以肯定(将拉链留在那里完好无损以保持自己被覆盖)。 I attempted Easy_install and it yielded a similar set of messages and end result error ( not posting it to reduce clutter of this post but will provide on request ).我尝试了 Easy_install,它产生了一组类似的消息和最终结果错误(不是为了减少这篇文章的混乱而发布它,而是根据要求提供)。

Any advice would be thoroughly appreciated.任何建议将不胜感激。 Thank you.谢谢你。

I faced the same problem while using 3.5.2 and 3.6.1 versions of the embedded python distribution zip for Windows.我在使用 3.5.2 和 3.6.1 版本的 Windows 嵌入式 python 发行版 zip 时遇到了同样的问题。 Though, with the MSI installer, this problem does not arise.但是,使用 MSI 安装程序不会出现此问题。

I suspect, this has something to do with the way the python3X.zip file is read for \\lib2to3\\Grammar.txt.我怀疑,这与为 \\lib2to3\\Grammar.txt 读取 python3X.zip 文件的方式有关。 Here is how I have resolved it :这是我解决它的方法:

  1. I have renamed the python35.zip file to something else (.zipp etc ..)我已将 python35.zip 文件重命名为其他内容(.zipp 等 ..)
  2. I have created a folder "python.zip" inside my original extracted folder我在原始提取的文件夹中创建了一个文件夹“python.zip”
  3. Made sure that "\\lib2to3\\Grammar.txt" is accessible within this folder.确保可以在此文件夹中访问“\\lib2to3\\Grammar.txt”。
  4. Ran "python -m pip install "运行“python -m pip install”
  5. Worked like a charm !像魅力一样工作!

A hack probably, but, could not find a way around.一个黑客可能,但是,找不到解决办法。

It seems, as you said, that you havent admin privileges.正如您所说,您似乎没有管理员权限。

Try to run for the current user, thus without admin privileges: pip install --user pyautogui尝试为当前用户运行,因此没有管理员权限: pip install --user pyautogui

对我来说,只需将python36.zip解压缩到文件夹python36.zip就可以了。

I had the same error, but it was related to the clearing of all *.pyc and pycache files in the dir: python-3.5.4-embed-amd64/ .我有同样的错误,但它与目录中所有 *.pyc 和pycache文件的清除有关: python-3.5.4-embed-amd64/ As I restored them all worked fine.当我恢复它们时,它们都运行良好。 But your method to extract python35.zip file to python35.zip folder worked as fine well.但是您将 python35.zip 文件解压缩到 python35.zip 文件夹的方法效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM