2017-06-13 53 views
1

我想使用pyinstaller创建我的python脚本的.exe文件。创建成功的exe文件,但是当我尝试运行它,CMD给出了错误:使用pyinstaller创建的exe无法执行

Import Error: Astropy requires the 'six' module of minimum version 1.10; normally this is bundled with the astropy package so if you get this warning consult the packager of your Astropy distribution. Failed to execute script MARK1

我已经安装了Astropy v1.33中。

+0

已经有多个关于这个问题;例如https://stackoverflow.com/questions/29052982/python-compiling-astropy-with-pyinstaller – Iguananaut

回答

2

看起来像这是一个已知的Astropy问题。以下是GitHub上Astropy开发的一些讨论:https://github.com/astropy/astropy/pull/960

这个问题也被要求前几次:

你可以尝试,包括六个在您的pyinstaller设置中隐藏导入。否则,您可能需要使用Astropy的冻结版本,并在其中添加了一些编辑以使其能够与pyinstaller一起使用。

+0

很高兴回应。但是如何将六个隐藏包含在pyinstaller设置中。 –

+0

我试过使用pyinstaller firstread.py [--hidden-import six]但它返回:脚本'C:\ Python34 \ Scripts \ [ - hidden-import'找不到 –

+0

糟糕,我的意思是隐藏导入。文档在这里:https://pythonhosted.org/PyInstaller/when-things-go-wrong.html#listing-hidden-imports – AlexM

相关问题