Cx_Freeze 5.0.1 + Python3.4 virtualenv错误

时间:2017-11-06 21:33:30

标签: python python-3.x build cx-freeze

我一直试图找出以下错误的含义,但不幸的是我无法处理它。执行生成的可执行文件产生的完整回溯是:

File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "/home/prog3/Ambiente/p34/lib/python3.4/site-packages/cx_Freeze-5.0.1-py3.4-linux-x86_64.egg/cx_Freeze/initscripts/__startup__.py", line 12, in <module>
__import__(name + "__init__")
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "/home/prog3/Ambiente/p34/lib/python3.4/site-packages/cx_Freeze-5.0.1-py3.4-linux-x86_64.egg/cx_Freeze/initscripts/Console.py", line 24, in <module>
exec(code, m.__dict__)
File "App.py", line 10, in <module>
File "/home/prog3/Ambiente/p34/lib/python3.4/site-packages/glymur/__init__.py", line 4, in <module>
from glymur import version
File "/home/prog3/Ambiente/p34/lib/python3.4/site-packages/glymur/version.py", line 15, in <module>
from distutils.version import LooseVersion
File "/home/prog3/Ambiente/p34/lib/python3.4/distutils/__init__.py", line 17, in <module>
real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY))
File "/home/prog3/Ambiente/p34/lib/python3.4/imp.py", line 245, in load_module
return load_package(name, filename)
File "/home/prog3/Ambiente/p34/lib/python3.4/imp.py", line 217, in load_package
return methods.load()
File "<frozen importlib._bootstrap>", line 1219, in load
AttributeError: 'NoneType' object has no attribute 'name'

我的setup.py文件如下:

import sys
from cx_Freeze import setup,Executable

includefiles = ['libopenjp2.so','libopenjp2.so.2.2.0','libopenjp2.so.7']
includes = []
excludes = ['Tkinter']
packages = ["os","sys","PyQt5.QtCore","PyQt5.QtGui","PyQt5.QtWidgets","numpy",  "subprocess","encodings","glymur","matplotlib","math","PIL","skimage","scipy","matplotlib.backends.backend_qt5agg","lxml","ctypes","re","collections","struct","contextlib","itertools","uuid","warnings"]
build_exe_options = {"packages":[],
        "excludes":["Tkinter"],"includefiles":['libopenjp2.so','libopenjp2.so.2.2.0','libopenjp2.so.7'],"includes":[],"copy_dependent_files":True
                }

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

setup(name='alignosis',
  version='0.1',
  description='Alignment of two differently stained whole-slide JPEG2000 digital pathology images',
  options = {'build_exe': {'includes':includes,'excludes':excludes,'packages':packages,'include_files':includefiles}},
  executables= [Executable('App.py')])

我必须说,一旦我的virtualenv包含所有必需的包,并且在执行上述setup.py后执行:
python setup.py build,我没有错误,所以它是创建了构建文件夹。

我知道可能我不需要包含如此大的包列表,因为其中一些是内置的,我很抱歉......

我感谢您给我的任何建议/帮助。 谢谢

0 个答案:

没有答案