質問

みそらくアントレプレナーシップにPython3.1を用いPyQt4.ているアプリケーションは、分散コンピュータなのいずれかの者を設置。

私はほとんど気にWindowsプラットフォームでの私の目標は単一の実行ファイル、もしかしたリソースファイル。dllます。

を検索したいという結論を出した

  • py2exe サポートするだけでなくPython upバージョン2.7
  • pyinstaller サポートするだけでなくPython upバージョン2.6
  • cx_Freeze せっかくのものは、以下の場合にはエラーを実行しようとしたところ私た数:

Y:\Users\lulz\build\exe.win32-3.1>system_shutdown.exe
Traceback (most recent call last):
File "Y:\Program Files (x86)\Python\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27, in exec(code, m.__dict__)
File "Y:/Users/lulz/Documents/Coding/Python3/projects/System Shutdown/system_shutdown.pyw", line 5, in from PyQt4 import QtCore
File "ExtensionLoader_PyQt4_QtCore.py", line 16, in AttributeError: 'NoneType' object has no attribute 'modules'

その後、私の問題は基本的には二つの問題はこちら

  1. しおりを付けることができなcx_Freezeをバイナリもます。
  2. 反対の場合、どのようなものcx_Freeze問題です。

きに関する詳しい情報提供を求めて二つ目の問題は必要であれば、私の話のcx_Freeze、私のdistutils設定スクリプトなど。

までのチームと言っても過言ではない。

役に立ちましたか?

解決

あなたはcx_Freezeパッケージにfreeze.pyするコードの1行を追加することによってこの問題を解決することができます。

これは、ここで説明されています。 http://www.mail-archive.com /cx-freeze-users@lists.sourceforge.net/msg00212.htmlする

これは、少なくとも私のために働いていた:)

乾杯、   ALMAR

他のヒント

Python3.3以降りの良い分解能:py2exe-生成シングル実行ファイル

イpy2exe:

pip install py2exe

その後の追加のほか'your_script.py'ファイルの'Make_exe.py'ファイル:

from distutils.core import setup
import py2exe, sys

class Make_exe():
    def __init__(self, python_script):
        sys.argv.append('py2exe')

        setup(
            console=[{'script': python_script}],
            zipfile = None,
            options={
                'py2exe': 
                {
                    'bundle_files': 1, 
                    'compressed': True,
                    # Add includes if necessary, e.g. 
                    'includes': ['lxml.etree', 'lxml._elementpath', 'gzip'],
                }
            }
        )

if __name__ == '__main__':
    Make_exe('your_script.py')

する場合がございますのでおmake'のyour_script.py' が、それはそれ自身を再構築 としてyour_script.exe' すでにpython, 追加することができ、そのメイン:

import subprocess
import sys

if __name__ == '__main__':
    currentFile = sys.argv[0]
    if currentFile.lower().endswith(".py"):
        exitCode = subprocess.call("python Make_exe.py")
        if exitCode==0 :
            dirName = os.path.dirname(currentFile)
            exeName = os.path.splitext(os.path.basename(currentFile))[0] + '.exe'
            exePath = dirName + "/dist/" + exeName
            cmd = [exePath] + sys.argv[1:]
            print ("Executing command:\n %s" % cmd)
            exitCode = subprocess.call(cmd)
        sys.exit(exitCode)
    else:
        print ("This will be executed only within the new generated EXE File...")
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top