2016-05-16 8 views
0

Pythonアプリケーションを実行可能に変換しようとしていますが、cx_Freezeが私のニーズに合わせて変更して使用するのが最も簡単だとわかりました。cx_FreezeがQtDesignerフレームワークを見つけることができません

これは私のsetup.pyスクリプトです:

from cx_Freeze import setup, Executable 

includefiles = ['Leaderboard.txt'] 
includes = ['PyQt4.QtGui', 'PyQt4.QtCore', 'functools.partial', 'multiprocessing.Process', 'sys'] 


setup(
    name = 'App', 
    version = '1.0', 
    description = 'Description', 
    author = 'ShellRox', 
    options = {'build_exe': {'include_files':includefiles}}, 
    executables = [Executable('Project.py', copyDependentFiles=True)] 
) 

完全なコードhere

error: [Errno 2] No such file or directory: 'QtDesigner.framework/Versions/4/QtDesigner' 

全ログhere:何らかの理由で


は、私はこのエラーを取得しています。

しかし、私はいくつかの研究を行った後、私の問題に合った結果が1つしか見つからず、全く役に立たない(私はパッケージを削除しました)。

サブモジュールだけをincludesに追加しましたが、まだ助けにならないでしょう、私の推測では、モジュールを探していなかったということです。

私の疑問に思うことは、私のreseources.pyファイルに関連するものがあるかどうかということです。

また、進行中の他のものを更新しなかったQtDesignerロケーションファイルをPathに追加しようとしました。

質問:

何が問題なのですか?どのように私はcx_Freezeでそれをブラックリストに載せることができますので、QtDesignerフレームワークを検索する必要はありません(便利でない場合)、Qt Designerを探すためにパスに場所を追加する必要がありますか?

答えて

0

cx_Freezeにはバイナリを除外するオプションがあります。不要なバイナリの検索をブロックするには、このオプションを使用します。

bin_excludes - list of names of files to exclude when determining dependencies of binary files that would normally be included; note that version numbers that normally follow the shared object extension are stripped prior to performing the comparison

ドキュメントから は、実行可能ファイルというこの

build_exe_options = { 
    "icon": iconPath, 
    "packages": packages, 
    "includes": includes, 
    "include_files": include_files, 
    "excludes": excludes, 
    "optimize": True, 
    "bin_excludes": ["QtDesigner"], 
    } 

しかし、あなたのコードが実際に必要に応じてどのようなbuild_exeオプション内のあなたのsetup.pyファイルにそのオプションを追加しますか? 'otool'を使って依存関係を調べると、PySide.QtUiToolsモジュールがqtdesignerを必要とすることがあります。

$ otool -L ~/lib/python2.7/site-packages/PySide/QtUiTools.so 
/lib/python2.7/site-packages/PySide/QtUiTools.so: 
    @rpath/libpyside-python2.7.1.2.dylib (compatibility version 1.2.0, current version 1.2.2) 
    /usr/local/lib/QtDesigner.framework/Versions/4/QtDesigner (compatibility version 4.8.0, current version 4.8.6) 
    /usr/local/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.6) 
    /usr/local/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.6) 
    @rpath/libshiboken-python2.7.1.2.dylib (compatibility version 1.2.0, current version 1.2.2) 
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) 
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) 

ですから、より良いQtDesignerが配置されている場所を見つけるとQtUiTools.soモジュールの正しい場所への検索パスを変更するには「install_name_tool」を使用。

関連する問題