0

当我运行installer.cfg 时,我不断收到我从未在我的代码中使用过的模块的“ModuleNotFoundError”。例如,我第一次运行它时得到“ModuleNotFoundError: No module named 'sip'”,所以我将 sip 包含在 installer.cfg 文件的包列表中,问题得到解决。但随后弹出了一个新的“ModuleNotFoundError”。因此,我不断在installer.cfg 文件中的包列表中添加越来越多的模块。

(我这样做是因为互联网上有人解释说他通过这样做解决了他与 Pynsist 的问题:https ://github.com/takluyver/pynsist/issues/123#issuecomment-322269903 - 我可能误解了这一点)

这是我应该做的吗?这似乎没有意义,因为它要求我导入我从未使用过的模块。我不知道我需要的随机模块列表什么时候结束。另外这很麻烦,因为现在我收到了“ImportError:DLL 加载失败:找不到指定的模块”。(指 tkinter)所以现在我必须安装一个我没有使用的模块。

安装程序.cfg:

[Application]
name=GUI
version=1.0
# How to launch the app - this calls the 'main' function from the 'myapp' 
package:
entry_point=gui:main

[Python]
version=3.6.5

[Include]
# Packages from PyPI that your application requires, one per line
packages = requests
  matplotlib
  seaborn
  numpy
  PyQt5
  sip
  six
  pyparsing
  cycler
  dateutil
  kiwisolver
  tkinter
  _tkinter
# These must have wheels on PyPI:
pypi_wheels = requests==2.18.4
     beautifulsoup4==4.6.0
     html5lib==0.999999999

# Other files and folders that should be installed

正在使用的模块:

import sys

from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *

import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import seaborn as sns

import numpy as np
from numpy.linalg import inv
4

0 回答 0