【问题标题】:cx_Freeze '@rpath/libQtDeclarative.4.dylib': doesn't exist or not a regular filecx_Freeze '@rpath/libQtDeclarative.4.dylib':不存在或不是常规文件
【发布时间】:2017-06-09 23:12:41
【问题描述】:
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

【问题讨论】:

  • 您的包含声明在哪里?

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


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-02-24
    • 1970-01-01
    • 2015-05-19
    • 2022-07-05
    • 2018-10-20
    • 2017-06-18
    • 2013-06-16
    相关资源
    最近更新 更多