我想构建我的程序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
如果我运行构建的 exe,它会返回:
Traceback (most recent call last):
File "C:\Users\Novot\AppData\Local\SineWave\SineWave.launch.pyw", line 31, in <module>
from main import main
File "C:\Users\Novot\AppData\Local\SineWave\pkgs\main.py", line 2, in <module>
import matplotlib.pyplot as plt
File "C:\Users\Novot\AppData\Local\SineWave\pkgs\matplotlib\pyplot.py", line 2372, in <module>
switch_backend(rcParams["backend"])
File "C:\Users\Novot\AppData\Local\SineWave\pkgs\matplotlib\pyplot.py", line 207, in switch_backend
backend_mod = importlib.import_module(backend_name)
File "importlib\__init__.py", line 126, in import_module
File "C:\Users\Novot\AppData\Local\SineWave\pkgs\matplotlib\backends\backend_tkagg.py", line 1, in <module>
from . import _backend_tk
File "C:\Users\Novot\AppData\Local\SineWave\pkgs\matplotlib\backends\_backend_tk.py", line 5, in <module>
import tkinter as Tk
ModuleNotFoundError: No module named 'tkinter'
而且,有没有办法导入另一个需要的所有库?