cx_Freeze'@ rpath / libQtDeclarative.4.dylib':不存在或不是常规文件

时间:2017-06-09 23:12:41

标签: macos python-2.7 qt4 pyqt4 cx-freeze

from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = ["idna","lib","gui","plugins"], excludes = ["Tcl","tcl"]

import sys
base = 'Win32GUI' if sys.platform=='win32' else None

executables = [
Executable('electrum-xvg', base=base, targetName = 'Electrum XVG',icon="electrum.icns")]

setup(name='electrum-xvg',
  version = '1.0',
  description = '',
  options = dict(build_exe = buildOptions),
  executables = executables])

我有上面的setup.py文件,我在OSX Sierra上尝试构建应用程序。但是当我使用python setup.py bdist_mac时会引发错误

@rpath/libQtDeclarative.4.dylib
error: can't copy '@rpath/libQtDeclarative.4.dylib': doesn't exist or not a regular file
我的系统libQtDeclarative.4.dylib中存在

~/anaconda/envs/pyqtapp/lib但是当我使用otool -D libQtDeclarative.4.dylib时,它引发了错误,即没有此类文件存在,所以我使用了

install_name_tool -id "@rpath/libQtDeclarative.4.dylib" libQtDeclarative.4.dylib
现在,当我~/anaconda/envs/pyqtapp/lib运行时,otool -D libQtDeclarative.4.dylib中的

libQtDeclarative.4.dylib:
@rpath/libQtDeclarative.4.dylib

但是cx_Freeze仍然会引发错误

error: can't copy '@rpath/libQtDeclarative.4.dylib': doesn't exist or not a regular file

1 个答案:

答案 0 :(得分:0)

尝试明确设置包含(相对路径列表):

includefiles = ['README.txt', 'CHANGELOG.txt', 'helpers\uncompress\unRAR.exe', , 'helpers\uncompress\unzip.exe']