2017-06-13 52 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

相關問題