build/exe.win-amd64-3.6/scipy/misc/pilutil.py; import Image; moduleNotFoundError:No module named Image
build/exe.win-amd64-3.6/scipy/misc/pilutil.py; import Image; moduleNotFoundError:No module named Image
我正在使用 python 构建 EXE 进行图像处理。
我正在使用 tkinter,cx_Freeze 构建应用程序。
我遇到错误
下面是 setup.py 文件:
from cx_Freeze import setup, Executable
import sys
import matplotlib
from PIL import Image
import numpy.core._methods
import numpy.lib.format
import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
base =None
if sys.platform == 'win32':
base = "Win32GUI"
executables=[
Executable("application.py",base=base)
]
options = {
'build_exe': {
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
os.path.join(r'C:\Users\rahul\Anaconda3\Lib\site-packages\scipy'),
],
'includes': ['numpy.core._methods', 'numpy.lib.format','numpy.matlib',
'multiprocessing.process','matplotlib.backends.backend_tkagg',
'matplotlib.backends.backend_qt5agg','PIL.Image',
],
},
}
setup(
name = "XXXXXXXXXXXX",
options = options,
version = "1.00",
description ="XXXXXXXXXXXXXXXXXXXXXXXXXX",
executables = executables
)
pip install Image
解决我的问题。
我正在使用 python 构建 EXE 进行图像处理。 我正在使用 tkinter,cx_Freeze 构建应用程序。
我遇到错误
下面是 setup.py 文件:
from cx_Freeze import setup, Executable
import sys
import matplotlib
from PIL import Image
import numpy.core._methods
import numpy.lib.format
import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
base =None
if sys.platform == 'win32':
base = "Win32GUI"
executables=[
Executable("application.py",base=base)
]
options = {
'build_exe': {
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
os.path.join(r'C:\Users\rahul\Anaconda3\Lib\site-packages\scipy'),
],
'includes': ['numpy.core._methods', 'numpy.lib.format','numpy.matlib',
'multiprocessing.process','matplotlib.backends.backend_tkagg',
'matplotlib.backends.backend_qt5agg','PIL.Image',
],
},
}
setup(
name = "XXXXXXXXXXXX",
options = options,
version = "1.00",
description ="XXXXXXXXXXXXXXXXXXXXXXXXXX",
executables = executables
)
pip install Image
解决我的问题。