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

隐身守侯 提交于 2019-12-22 12:38:13

问题


I am attempting to "pip install" PyAutoGUI ( among other modules ) and I am getting the following error :

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 ). 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. I've done clean extractions of the zip and found the same problem.

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 )

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 ). 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 ).

Any advice would be thoroughly appreciated. Thank you.


回答1:


I faced the same problem while using 3.5.2 and 3.6.1 versions of the embedded python distribution zip for Windows. Though, with the MSI installer, this problem does not arise.

I suspect, this has something to do with the way the python3X.zip file is read for \lib2to3\Grammar.txt. Here is how I have resolved it :

  1. I have renamed the python35.zip file to something else (.zipp etc ..)
  2. I have created a folder "python.zip" inside my original extracted folder
  3. Made sure that "\lib2to3\Grammar.txt" is accessible within this folder.
  4. Ran "python -m pip install "
  5. Worked like a charm !

A hack probably, but, could not find a way around.




回答2:


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




回答3:


For me just unzipping the python36.zip to a folder python36.zip did the trick.



来源:https://stackoverflow.com/questions/42962765/embedded-python-3-5-python-setup-py-egg-info-failed-with-error-code-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!