Getting error when using pynput with pyinstaller

故事扮演 提交于 2020-12-30 03:00:52

问题


A friend of mine asked me to write him a program, and I used pynput to handle some of the inputs and other features. When I convert the program an executable with pyinstaller, launcing the executable gives me this error: File "site-packages\pynput\keyboard\__init__.py", line 31, in <module> File "site-packages\pynput\_util\__init__.py", line 82, in backend ImportError [11492] Failed to execute script friend_project

I have tried using the pyinstaller command pyinstaller --onefile friend_project.py, and also using auto-py-to-exe to run it.

Using pyinstaller with other modules like pygame or pyopengl gives me no error, but this one module does. Running the script by it self with the python inturpeter works fine, but I would perfer to have it be an exe so I can give it to him with out him needing python to run it.


回答1:


Please fall back to 1.6.8 version of pynput. pip install pynput==1.6.8



来源:https://stackoverflow.com/questions/63681770/getting-error-when-using-pynput-with-pyinstaller

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