2016-07-16 17 views
0

をパックするpyInstallerのを使用する場合、私はEXE、ショーのエラーメッセージ実行したときに、私は私のプログラム、 をパックするpyInstallerのを使用します。 はImportError:「xlsxwriter」という名前のないモジュールはImportError:「xlsxwriter」という名前のないモジュール - 私はプログラム

私はこのプログラムを実行できると確信しています。 とxlsxwriterがインストールされています。

この問題を解決するにはどうすればよいですか?

ありがとうございました。

以下

が、私は同じ問題を持っていた.specファイル

# -*- mode: python -*- 
block_cipher = None 
a = Analysis(['Main.py'], 
     pathex=['C:\\Users\\510428\\Desktop\\Ming and Sonic project\\Python_MingAndSonic'], 
     binaries=None, 
     datas=None, 
     hiddenimports=[], 
     hookspath=None, 
     runtime_hooks=None, 
     excludes=None, 
     win_no_prefer_redirects=None, 
     win_private_assemblies=None, 
     cipher=block_cipher) 
pyz = PYZ(a.pure, a.zipped_data, 
     cipher=block_cipher) 
exe = EXE(pyz, 
     a.scripts, 
     a.binaries, 
     a.zipfiles, 
     a.datas, 
     name='Main', 
     debug=False, 
     strip=None, 
     upx=True, 
     console=True) 
+0

あなたが同様のにはいくつかの解決策を試してみました問題?たぶん[ここ](http://stackoverflow.com/a/25848112/4545777)?コンパイル中にエラーが発生していますか? – Cnly

+0

[pyinstaller、specファイル、ImportErrorの可能な複製: 'blah'という名前のモジュールがありません](http://stackoverflow.com/questions/7436132/pyinstaller-spec-file-importerror-no-module-named-blah) – user1251007

答えて

1

である、あなたはspecファイルの隠されたパラメータにモジュールを含める必要があります:

a = Analysis(['Main.py'], 
    pathex=['C:\\Users\\510428\\Desktop\\Ming and Sonic project\\Python_MingAndSonic'], 
    binaries=None, 
    datas=None, 
    hiddenimports=['xlsxwriter'], #here 
    hookspath=None, 
    runtime_hooks=None, 
    excludes=None, 
    win_no_prefer_redirects=None, 
    win_private_assemblies=None, 
    cipher=block_cipher) 
関連する問題