无法打包使用pyinstaller导入matplotlib的python脚本
我正在尝试使用pyinstaller打包无法打包使用pyinstaller导入matplotlib的python脚本,python,matplotlib,pyinstaller,Python,Matplotlib,Pyinstaller,我正在尝试使用pyinstaller打包 操作系统:windows7 32 python:2.7.9 pyinstaller:2.0 我的代码包含以下导入: #!/usr/bin/env python # -*- coding: utf-8 -*- #Created Time: 2015/9/8 18:48:04 from matplotlib.figure import Figure from matplotlib.backends.backend
- 操作系统:windows7 32
- python:2.7.9
- pyinstaller:2.0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Created Time: 2015/9/8 18:48:04
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import (
FigureCanvasQTAgg as FigureCanvas)
from matplotlib.ticker import FuncFormatter
from matplotlib.ticker import MultipleLocator
from matplotlib import rcParams
rcParams['font.sans-serif'] = ['SimHei']
rcParams['axes.unicode_minus'] = False
from PyQt4 import QtGui
from PyQt4 import QtCore
在CMD中运行命令:
python pyinstaller.py matplot.py-D-w
输出:
Traceback (most recent call last):
File "pyinstaller.py", line 91, in <module>
main()
File "pyinstaller.py", line 86, in main
run_build(opts, spec_file)
File "pyinstaller.py", line 50, in run_build
PyInstaller.build.main(spec_file, **opts.__dict__)
File "F:\pyinstaller-2.0\PyInstaller\build.py", line 1625, in main
build(specfile, buildpath)
File "F:\pyinstaller-2.0\PyInstaller\build.py", line 1582, in build
execfile(spec)
File "F:\pyinstaller-2.0\matplot\matplot.spec", line 5, in <module>
hookspath=None)
File "F:\pyinstaller-2.0\PyInstaller\build.py", line 389, in __init__
self.__postinit__()
File "F:\pyinstaller-2.0\PyInstaller\build.py", line 315, in __postinit__
self.assemble()
File "F:\pyinstaller-2.0\PyInstaller\build.py", line 475, in assemble
importTracker.analyze_script(script)
File "F:\pyinstaller-2.0\PyInstaller\depend\imptracker.py", line 205, in analy
ze_script
return self.analyze_r('__main__')
File "F:\pyinstaller-2.0\PyInstaller\depend\imptracker.py", line 98, in analyz
e_r
newnms = self.analyze_one(name, nm, imptyp, level)
File "F:\pyinstaller-2.0\PyInstaller\depend\imptracker.py", line 159, in analy
ze_one
mod = self.doimport(nm, ctx, fqname)
File "F:\pyinstaller-2.0\PyInstaller\depend\imptracker.py", line 256, in doimp
ort
hooks = __import__('PyInstaller.hooks', globals(), locals(), [hookmodnm])
TypeError: Item in ``from list'' not a string
回溯(最近一次呼叫最后一次):
文件“pyinstaller.py”,第91行,在
main()
文件“pyinstaller.py”,主目录第86行
运行构建(选项、规范文件)
文件“pyinstaller.py”,第50行,在run_build中
PyInstaller.build.main(规范文件,**opts.\uuuuu dict\uuuu)
文件“F:\pyinstaller-2.0\pyinstaller\build.py”,第1625行,主目录
构建(specfile,buildpath)
文件“F:\pyinstaller-2.0\pyinstaller\build.py”,第1582行,内部版本
执行文件(规范)
文件“F:\pyinstaller-2.0\matplot\matplot.spec”,第5行,在
hookspath=无)
文件“F:\pyinstaller-2.0\pyinstaller\build.py”,第389行,在\uuu init中__
self.\uuuu postinit\uuuuu()
文件“F:\pyinstaller-2.0\pyinstaller\build.py”,第315行,在__
self.assembly()
文件“F:\pyinstaller-2.0\pyinstaller\build.py”,第475行,汇编
importTracker.analyze_脚本(脚本)
文件“F:\pyinstaller-2.0\pyinstaller\depend\imptracker.py”,第205行,在分析中
泽乌文字
返回self.analysis\r(“”\u\u main\u')
文件“F:\pyinstaller-2.0\pyinstaller\depend\imptracker.py”,第98行,在analyz中
e_r
newnms=self.analyze_one(名称、nm、imptyp、级别)
文件“F:\pyinstaller-2.0\pyinstaller\depend\imptracker.py”,第159行,在分析中
泽乌一号
mod=self.doimport(nm、ctx、fqname)
文件“F:\pyinstaller-2.0\pyinstaller\depend\imptracker.py”,第256行,在doimp中
奥特
hooks=\uuuuu import\uuuu('PyInstaller.hooks',globals(),locals(),[hookmodnm])
TypeError:“来自列表”中的项不是字符串
谢谢你的帮助 它在python3.4 pyqt5 pyinstaller-python3上工作
谢谢 py2exe是如何参与其中的?