问题
I have been trying to figure out what the following error means but unfortunately I am not being able to handle it. The complete traceback resulting from the execution of the generated executable is:
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'
My setup.py file looks like:
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')])
I must say that once my virtualenv containing all the required packages is activated and after execution of the above setup.py by: python setup.py build
,
I get no errors and so it is created the build folder.
I am aware that probably I dont need to have a so big list of packages to include given that some of them are built-in and I am sorry for that...
I appreciate any suggestion/help that you can give to me. Thank you
来源:https://stackoverflow.com/questions/47146196/cx-freeze-5-0-1-python3-4-virtualenv-error