安装PyUserInput报错解决

python3.5安装PyUserInput报错,前提我的机器已经安装了pyhook和win32,但是使用

pip install PyUserInput

安装时,还是报错以下信息:

C:\xview_autotest\python-3.5.0-embed-amd64\Scripts>pip install PyUserInput
Looking in indexes: https://pypi.douban.com/simple
Collecting PyUserInput
  Using cached https://pypi.doubanio.com/packages/d0/09/17fe0b16c7eeb52d6c14e904
596ddde82503aeee268330120b595bf22d7b/PyUserInput-0.1.11.tar.gz (28 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\xview_autotest\python-3.5.0-embed-amd64\python.exe' -c 'import
 sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ADMINI~1\\AppData\\Loc
al\\Temp\\pip-install-4pbc5mdh\\PyUserInput\\setup.py'"'"'; __file__='"'"'C:\\Us
ers\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-4pbc5mdh\\PyUserInput\\setup.py
'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace(
'"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"
'"'))' egg_info --egg-base 'C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg-inf
o-w8frwc_3'
         cwd: C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-4pbc5mdh\PyUserIn
put\
    Complete output (8 lines):
    running egg_info
    creating C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg-info-w8frwc_3\PyUs
erInput.egg-info
    writing dependency_links to C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg
-info-w8frwc_3\PyUserInput.egg-info\dependency_links.txt
    writing requirements to C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg-inf
o-w8frwc_3\PyUserInput.egg-info\requires.txt
    writing C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg-info-w8frwc_3\PyUse
rInput.egg-info\PKG-INFO
    writing top-level names to C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg-
info-w8frwc_3\PyUserInput.egg-info\top_level.txt
    writing manifest file 'C:\Users\ADMINI~1\AppData\Local\Temp\pip-pip-egg-info
-w8frwc_3\PyUserInput.egg-info\SOURCES.txt'
    error: [Errno 2] No such file or directory: 'c:\\xview_autotest\\python-3.5.
0-embed-amd64\\python35.zip\\lib2to3\\Grammar.txt'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.

查了很久查不到怎么解决,网上的大多数PyUserInput报错都是让先安装pyhook,后来看到这个报错信息:

No such file or directory: 'c:\\xview_autotest\\python-3.5.
0-embed-amd64\\python35.zip\\lib2to3\\Grammar.txt'

去我的安装目录下查看了,这些文件都是存在的,最后的解决办法属实搞笑,我目录里的python35.zip文件是个压缩包,安装程序没法在里面找文件,解决办法:

在python目录下新建一个文件夹,命名为“python35.zip”,再把原python35.zip压缩包里的文件解压后放进这个新建的文件夹,问题就解决了:

再次安装:

C:\xview_autotest\python-3.5.0-embed-amd64\Scripts>pip install PyUserInput
Looking in indexes: https://pypi.douban.com/simple
Collecting PyUserInput
  Using cached https://pypi.doubanio.com/packages/d0/09/17fe0b16c7eeb52d6c14e904
596ddde82503aeee268330120b595bf22d7b/PyUserInput-0.1.11.tar.gz (28 kB)
Requirement already satisfied: pyHook in c:\xview_autotest\python-3.5.0-embed-am
d64\lib\site-packages (from PyUserInput) (1.5.1)
Requirement already satisfied: pywin32 in c:\xview_autotest\python-3.5.0-embed-a
md64\lib\site-packages (from PyUserInput) (225)
Building wheels for collected packages: PyUserInput
  Building wheel for PyUserInput (setup.py) ... done
  Created wheel for PyUserInput: filename=PyUserInput-0.1.11-py3-none-any.whl si
ze=37185 sha256=c132bb828f382a0879567d0f6d9924b9b16ca442cfd5205b31258c7514fe6ce7

  Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\90\
d8\54\cc8ff65552cf02df496cba18e00797947e25ef7ee4e0f9aa1f
Successfully built PyUserInput
Installing collected packages: PyUserInput
Successfully installed PyUserInput-0.1.11

 


版权声明:本文为xihappy原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。