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 "<string>", line 11, in <module>
  File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__diact__)
  File "site-packages\pkg_resources\__init__.py", line 74, in <module>
  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脚本再运行,问题解决。

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值