Kivy Pyinstaller打包报: No module named pkg_resources.py2_warn
概况
Kivy 编写的应用代码以源码运行正常,更新Pycharm后打包报异常, 使用Pyinstaller 打包时候会报No module named pkg_resources.py2_warn
可疑的地方是安装只有Pycharm, 更新Pycharm前打包能正常运行,在Pycharm 加载工程的时候把pip 和setuptools更新了,所以导致异常.
环境:Win10 + Python3.6.7
异常时候会的模块列表:
Package Version ----------------------------- ---------- alabaster 0.7.12 altgraph 0.16.1 Babel 2.6.0 begins 0.9 blessings 1.7 bsdiff4 1.1.5 certifi 2018.11.29 chardet 3.0.4 colorama 0.4.1 ConcurrentLogHandler 0.9.1 coverage 5.0.3 curtsies 0.3.0 cycler 0.10.0 Cython 0.29.6 docutils 0.14 easycython 1.0.7 future 0.17.1 future-stubs 0.18.0.0 gprof2dot 2017.9.19 graphviz 0.13 greenlet 0.4.15 HTMLReport 2.1.4 idna 2.8 imagesize 1.1.0 iso8601 0.1.12 Jinja2 2.10.1 Kivy 1.11.1 kivy-deps.glew 0.1.12 kivy-deps.glew-dev 0.1.12 kivy-deps.gstreamer 0.1.17 kivy-deps.gstreamer-dev 0.1.17 kivy-deps.sdl2 0.1.22 kivy-deps.sdl2-dev 0.1.22 Kivy-Garden 0.1.4 kiwisolver 1.1.0 macholib 1.11 MarkupSafe 1.1.1 matplotlib 3.1.2 memory-profiler 0.55.0 numpy 1.16.2 opencv-python 4.1.1.26 packaging 19.0 peewee 2.10.2 pefile 2018.8.8 Pillow 5.4.1 pip 20.1 plink 2.2 psutil 5.5.1 py-spy 0.1.5 pyenchant 2.0.0 Pygments 2.3.1 PyInstaller 3.6 Pympler 0.8 pymssql 2.1.4 pyparsing 2.4.0 pypiwin32 223 pyserial 3.4 python-dateutil 2.8.1 pythonnet 2.4.0 pytz 2019.1 pywin32 227 pywin32-ctypes 0.2.0 PyYAML 3.13 qrcode 6.1 redis 3.2.1 requests 2.21.0 setuptools 46.4.0 shiboken2 5.14.0 six 1.12.0 snowballstemmer 1.2.1 sortedcontainers 2.1.0 Sphinx 2.0.1 sphinxcontrib-applehelp 1.0.1 sphinxcontrib-devhelp 1.0.1 sphinxcontrib-htmlhelp 1.0.2 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.2 sphinxcontrib-serializinghtml 1.1.3 sqlparse 0.3.0 suds-jurko 0.6 tk-main 0.0.0 typing 3.6.6 unified-api-pkg 0.31 urllib3 1.24.1 wcwidth 0.1.7 wheel 0.33.1 xmltodict 0.12.0
之后把pip 和setuptools 降级了正常了
pip 10.0.1 setuptools 41.0.1
安装方法:
python -m pip install pip==10.0.1 -i https://pypi.douban.com/simple python -m pip install setuptools==41.0.1 -i https://pypi.douban.com/simple
参考
相关推荐
bigname 2012-08-12
rojyang 2019-02-28
tobebest 2018-11-26
linbossdeboke 2019-01-29
FalseNotFalse 2017-11-22