pyinstaller打包出错TypeError: ‘module‘ object is not callable;

一开始就是各种报错

什么情况都有

Such as:

上图是不写        -w         出来的结果,反正都大差不差

要不然就是写了        -w        直接跳白框

出来这么一句话:Module object for pyimod02_importers is NULL!

下面也是白框:

无论是哪一种,我都试过了,各种方法也试过了!!!都没有用

Such as:-p指定位置啥的一大堆;都没用

这还算是比较靠谱的了:

最后不管那么多,直接更新

pip install --upgrade pyinstaller

首先,`Module object for pyimod02_importers is NULL!` 这个错误可能表明 PyInstaller 在构建程序的时候没有正确地包含 `pyimod02_importers` 这个模块。

其次,`ModuleNotFoundError: No module named ipaddress` 这个错误表明你的程序试图导入一个名为 `ipaddress` 的模块,但是 Python 没有找到这个模块。`ipaddress` 是 Python 的标准库的一部分,所以这个问题可能表明你的 Python 环境缺少一些标准库。

以下是一些可能的解决方案:

1. 针对 `pyimod02_importers` 的问题,你可以尝试更新 PyInstaller 到最新版本。有时候这类问题是由于 PyInstaller 的 bug 导致的,更新 PyInstaller 可能会解决问题:

pip install --upgrade pyinstaller

2. 针对 `ipaddress` 的问题,你可以尝试更新你的 Python 环境。如果你的 Python 版本过旧,可能缺少一些标准库。你可以通过以下命令检查你的 Python 版本:

python --version

如果 Python 版本过旧,你可能需要升级到新版本。你可以通过以下命令升级 Python:

# For Windows
py -m pip install --upgrade pip
py -m pip install --upgrade python

# For Linux/macOS
python -m pip install --upgrade pip
python -m pip install --upgrade python

没想到!!!

一点小问题-->

The 'pathlib' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in C:\Users\Zx177\anaconda3\Lib\site-packages) using
    conda remove
then try again.

然后照做

conda remove pathlib

接着是:

然后再打包:Watting~~~~

点击dist----->>>>>>>>>>>>>>>>>>>>>>>>>>

Executive--------->>>>>>>

Successfully!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值