【问题标题】:pyinstaller: AttributeError module 'webbot' has no attribute 'data'pyinstaller:AttributeError 模块“webbot”没有属性“数据”
【发布时间】:2019-02-16 21:55:13
【问题描述】:

这个问题已经出现了很多次,但不幸的是,没有一个是我的情况,而是一个(起初)。 How to use pyInstaller to completely pack all the necessary Library?

我使用多个库在 Python 中编写了一个脚本,其中一个是 webbot 模块。我设法将脚本转换为 .exe 文件,但是当我尝试运行 .exe 时出现以下错误:

Traceback (most recent call last):
    File "TM.py", line 132, in <module>
    File "site-packages\webbot\webbot.py", line 45, in __init__
FileNotFoundError: [WinError 3]The system could not find the path...

然后我按照上面链接中的说明进行操作。

然后我收到以下错误消息:

Traceback (most recent call last):
    File "TM3.py", line 12, in <module>
AttributeError: module 'webbot' has no attribute 'data'
[9292] Failed to execute script TM3

第 12 行在哪里:

webbot.data.path.append(r'webbot_master_data')

有人可以帮我吗?

提前致谢

使用:

窗口:10

PyInstaller:3.4

Python:3.6.5

【问题讨论】:

    标签: python python-3.x pyinstaller attributeerror


    【解决方案1】:

    在这种情况下,我只需将 webbot 模块的文件复制到正在创建我的 .exe 文件的同一文件夹中。我也可以在此文件夹中保存其他模块。

    将文件复制到那里后,执行应该会运行。然而,这可能更像是一种解决方法而不是解决方案,所以我不会接受我的答案作为答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-28
      • 1970-01-01
      • 2018-04-18
      • 1970-01-01
      • 1970-01-01
      • 2020-06-04
      • 2021-12-24
      相关资源
      最近更新 更多