【问题标题】:cx Freeze "[Error 3] The system cannot find the path specified"cx Freeze "[错误 3] 系统找不到指定的路径"
【发布时间】:2017-01-05 15:17:29
【问题描述】:

Windows 7 x64、Python 2.7(Anaconda 发行版)、cx_Freeze 5.0。

我使用 PyQt4 制作了一个 GUI 应用程序,并试图冻结 python 脚本,但出现以下错误:

Copying data from package PyQt4...
copying C:\Users\Ben\Anaconda2\lib\site-packages\PyQt4\QtCore.pyd -> build\exe.win-amd64-2.7\PyQt4\QtCore.pyd
copying C:\Users\Ben\Anaconda2\Library\bin\QtCore4.dll -> build\exe.win-amd64-2.7\QtCore4.dll
copying C:\Users\Ben\Anaconda2\Library\bin\MSVCP90.dll -> build\exe.win-amd64-2.7\MSVCP90.dll
copying C:\Users\Ben\Anaconda2\lib\site-packages\PyQt4\QtGui.pyd -> build\exe.win-amd64-2.7\PyQt4\QtGui.pyd
copying C:\Users\Ben\Anaconda2\Library\bin\QtGui4.dll -> build\exe.win-amd64-2.7\QtGui4.dll
copying C:\Users\Ben\Anaconda2\Library\bin\libpng16.dll -> build\exe.win-amd64-2.7\libpng16.dll
copying C:\Users\Ben\Anaconda2\lib\site-packages\PyQt4\QtSvg.pyd -> build\exe.win-amd64-2.7\PyQt4\QtSvg.pyd
copying C:\Users\Ben\Anaconda2\Library\bin\QtSvg4.dll -> build\exe.win-amd64-2.7\QtSvg4.dll
Copying data from package _dummy_thread...
Copying data from package _markerlib...
error: [Error 3] The system cannot find the path specified: 'C:\\Users\\Ben\\Anaconda2\\lib\\site-packages\\setuptools-19.2-py2.7.egg\\_markerlib/*.*'

我的 cx 冻结设置文件是:

import sys
from cx_Freeze import setup, Executable
#import matplotlib

base = None
if sys.platform == "win32":
    base = "Win32GUI"

build_options = {"packages":["matplotlib", "xlrd", "xlwt"],
                 "include_files":["Mefisto_logo.jpg", "LOGO H2020 RIA.png", "logo_h2020_transparent.png",
                                  "logo_minouw.png", "logo-csic.png", "logo-icm.png", "logo-icm-ca-csic.png"] }

executables = [Executable("mefisto_main_10.py", base=base, icon="Mefisto_logo.ico")]
# Note for some reason the icon must be .ico - cx freeze will not work with either jpg or png


setup(name = "Mefisto",
      version = "4.01",
      description = "Mediterranean fisheries simulation tool",
      options = {"build_exe": build_options},
      executables = executables            
      )

感谢您提供的任何帮助。

【问题讨论】:

  • 找到包含您的python文件和任何其他文件的文件夹,右键单击它,然后从选项中打开一个命令窗口。从那里做 python setuppy 构建。希望这会有所帮助。
  • 之前我从命令提示符运行为:“python setup.py build”(脚本从这里开始工作并到达上述错误)。如果我在命令提示符下使用“setup.py build”,那么什么也不会发生。谢谢你的帮助。

标签: python windows python-2.7 pyqt4 cx-freeze


【解决方案1】:

好吧,我在post 中找到了基于 cmets 的问题的解决方案。

我改了扩展名

setuptools-19.2-py2.7.egg

压缩和解压缩它。然后 cx_freeze 脚本运行并创建了构建。 (但是我还有另一个问题 - 单击时创建的 exe 不执行任何操作 - but that's my next investigation...)

【讨论】:

    猜你喜欢
    • 2015-11-28
    • 1970-01-01
    • 2019-12-22
    • 2020-06-24
    • 1970-01-01
    • 2020-05-27
    • 2017-02-05
    • 1970-01-01
    • 2018-12-03
    相关资源
    最近更新 更多