【问题标题】:Pyinstaller fails to import site module in python3 on MacOSXPyinstaller 无法在 MacOS 上的 python3 中导入站点模块
【发布时间】:2018-07-30 06:40:03
【问题描述】:

我正在尝试使用 pyinstaller(版本 3.3.1)打包(冻结)python3 应用程序

在运行pyinstaller my_script.py 后,它会失败并显示导入错误列表,其中第一个错误如下:

292 INFO: checking Analysis
292 INFO: Building Analysis because out00-Analysis.toc is non existent
292 INFO: Initializing module dependency graph...
298 INFO: Initializing module graph hooks...
299 INFO: Analyzing base_library.zip ...
Failed to import the site module
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 544, in <module>
main()
...

...并继续列出更长的导入错误 可能是我的 python3 配置或 pyinstaller 规范文件有问题。 我目前正在使用默认的 pyinstaller 规范文件。 以下是我正在测试的系统:

  • MacOSX 10.13.3(高山脉)
  • Python 3.6.4(使用 brew 安装)
  • pyinstaller 3.3.1(使用 pip 安装)

非常感谢您的帮助。

【问题讨论】:

    标签: python-3.x macos pyinstaller macos-high-sierra


    【解决方案1】:

    Mac 10.13.3

    Python 3.6.4

    Pyinstaller 3.3.1

    我遇到了这个问题,我的解决办法是:

    pip3 uninstall enum34

    根据Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?

    【讨论】:

      猜你喜欢
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      • 2021-04-04
      • 1970-01-01
      • 1970-01-01
      • 2018-08-18
      • 1970-01-01
      • 2019-10-08
      相关资源
      最近更新 更多