Can't run python script converted to exe

廉价感情. 提交于 2019-12-12 03:23:56

问题


I have created a python program that sends data to google spreadsheets using the following external libaries:

  • json
  • gspread
  • oauth2client

The program works as expected, however when I tried to convert it to an executable, I would get the following error every time I rune the .exe file:

Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec(code, m.__dict__)
File "Demo.py", line 13, in <module>
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 140, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 1630, in __init__
_RequireCryptoOrDie()
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 1581, in _RequireCryptoOrDie
raise CryptoUnavailableError('No crypto library available')
oauth2client.client.CryptoUnavailableError: No crypto library available

Would any of you guys know what the problem could be, and what steps I could take to solve it?

Thanks in advance

Edit: I tried to use both cx_freeze and py2exe. I got similar errors in both

Below is the setup.py I used in cx_freeze:

from cx_Freeze import setup, Executable

setup(name = "Demo" ,
  version = "1.0" ,
  description = "A python Demo" ,
  executables = [Executable("Demo.py")])

来源:https://stackoverflow.com/questions/35185411/cant-run-python-script-converted-to-exe

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