python - 未找到模块(无条件导入):
问题描述
你好 !我正在尝试使用 py2app 为 mac os 生成 Python 脚本的独立应用程序。但它给了我以下错误
未找到模块(无条件导入):
- ConfigParser (kivy.config, kivy.tools.report)
- ConfigParser.ConfigParser (numpy.distutils.npy_pkg_config, numpy.distutils.system_info)
- ConfigParser.NoOptionError (kivy.config, kivy.tools.report, numpy.distutils.npy_pkg_config)
- ConfigParser.RawConfigParser (kivy.config, kivy.tools.report)
- Cython (numpy.random._examples.cython.setup)
- IPython(IPython.core.pylabtools、IPython.kernel.comm、matplotlib.backends.backend_nbagg)
- IPython.core (IPython.core, matplotlib.pyplot)
- IPython.core.pylabtools (IPython.core.pylabtools)
- IPython.core.pylabtools.backend2gui (IPython.core, matplotlib.backend_bases)
- IPython.display (matplotlib.backends.backend_nbagg)
- IPython.get_ipython(IPython.core、IPython.display、IPython.kernel、matplotlib.backend_bases)
- IPython.kernel (matplotlib.backends.backend_nbagg)
- IPython.kernel.comm (matplotlib.backends.backend_nbagg)
- 图片(docutils.parsers.rst.directives.images、docutils.writers._html_base、kivy.core.image.img_pil)
- OpenSSL (urllib3.contrib.pyopenssl)
from setuptools import setup
`APP = ['gui.py'] `
`DATA_FILES = ['main.py','fonts/add.png','fonts/FUTURASTD-
BOOK.OTF','fonts/FasterThanST-LETOM.otf','yest.avi']`
`APP_NAME = 'Fast'`
`OPTIONS = {
'argv_emulation': True,
'includes':['PyQt5','PyQt5.QtWidgets','kivy','cv2','scipy'],
'iconfile': 'app.icns',
'packages': ['kivy','cv2','scipy']
}`
`setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
`
解决方案
推荐阅读
- sql - Oracle SQL Developer - 如何查看 OLAP 脚本列表而不是执行?
- html - 带有名称的元素未通过 POST 与表单数据一起发送
- linux - git push --mirror - 内部服务器错误
- javascript - d3js v5 标准化堆积条形图
- c - 在 C 中打开文件后 fscanf 出现问题
- node.js - 无法在节点应用程序中使用 axios 在 POST 请求中正确添加文件头
- c++ - 使 C++ Pi 近似在 GPU Nvidia 970M CUDA 上并行运行
- python - 用python循环遍历json响应对象
- javascript - D3 词云布局圆形和矩形
- java - 计算 BigDecimal 会导致答案不准确