NSIS:无法导入修补匠
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NSIS:无法导入修补匠相关的知识,希望对你有一定的参考价值。
我想构建我的程序使用matplotlib
,这需要tkinter
。问题是我不能包括tkinter
,因为它不在pyPi上(它现在有轮子)。
我使用Pynsist构建NSIS安装程序。这是cfg:
[Application]
name=SineWave
version=1.0
# How to launch the app - this calls the 'main' function from the 'myapp' package:
entry_point=main:main
icon=sinewave.ico
[Python]
version=3.6.5
[Include]
# Packages from PyPI that your application requires, one per line
# These must have wheels on PyPI:
pypi_wheels = numpy==1.16.1
matplotlib==3.0.3
pyparsing==2.4.0
cycler==0.10.0
six==1.11.0
python-dateutil==2.8.0
kiwisolver==1.0.1
anaconda-project==0.8.2
如果我运行builded exe它会返回:
Traceback (most recent call last):
File "C:UsersNovotAppDataLocalSineWaveSineWave.launch.pyw", line 31, in <module>
from main import main
File "C:UsersNovotAppDataLocalSineWavepkgsmain.py", line 2, in <module>
import matplotlib.pyplot as plt
File "C:UsersNovotAppDataLocalSineWavepkgsmatplotlibpyplot.py", line 2372, in <module>
switch_backend(rcParams["backend"])
File "C:UsersNovotAppDataLocalSineWavepkgsmatplotlibpyplot.py", line 207, in switch_backend
backend_mod = importlib.import_module(backend_name)
File "importlib\__init__.py", line 126, in import_module
File "C:UsersNovotAppDataLocalSineWavepkgsmatplotlibackendsackend_tkagg.py", line 1, in <module>
from . import _backend_tk
File "C:UsersNovotAppDataLocalSineWavepkgsmatplotlibackends\_backend_tk.py", line 5, in <module>
import tkinter as Tk
ModuleNotFoundError: No module named 'tkinter'
还有,有没有办法导入另一个所需的所有库?
答案
我在文档中找到了它:Pynsist documentation
“因为Pynsist使用Python的”捆绑“版本,默认情况下不包含tkinter模块。如果你的应用程序依赖于tkinter来获取GUI,那么你需要找到以下资产......”
以上是关于NSIS:无法导入修补匠的主要内容,如果未能解决你的问题,请参考以下文章