pyinstaller ImportError: The 'packaging' package is required; ...

运行python2.6.6上使用pyinstaller打包的应用程序报错ImportError: The ‘packaging’ package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.

问题描述

运行python2.6.6上使用pyinstaller打包的应用程序报下面的错误

Traceback (most recent call last):File "", line 11, in File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_moduleexec(bytecode, module.__diact__)File "site-packages\pkg_resources\__init__.py", line 74, in File "site-packages\pkg_resources\extern\__init__.py", line 60, in load_module
ImportError: The 'packaging' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.
pyi_rth_pkgres returned -1

解决办法

使用 pip list 查看已经安装的包,发现是setuptools包的版本太高,环境里的setuptools版本是20.x.x。

果断卸载并安装低版本的setuptools(19.2),如下:

pip uninstall setuptools
pip install setuptools==19.2

重新打包python脚本再运行,问题解决。


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部