首页 > 解决方案 > 未找到模块(无条件导入):

问题描述

你好 !我正在尝试使用 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'],
)   

`

标签: pythonmacoskivyexecutablepy2app

解决方案


推荐阅读