【问题标题】:Missing dll files using PyInstaller on Windows在 Windows 上使用 PyInstaller 丢失 dll 文件
【发布时间】:2020-11-30 11:53:44
【问题描述】:

我跑完之后:

pyupdater build -F --app-version 0.0.1 app.py

我收到一个错误:

[INFO] PyUpdater 3.1.1
[INFO] Compiling...
Python library not found: libpython3.7.dll, libpython37m.dll, libpython3.7m.dll, python37.dll, libpython37.dll
    This would mean your Python installation doesn't come with proper library files.
    This usually happens by missing development package, or unsuitable build parameters of Python installation.
    * On Debian/Ubuntu, you would need to install Python development packages
      * apt-get install python3-dev
      * apt-get install python-dev
    * If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)

环境:

  • Windows 10
  • Python 3.7.9
  • PyUpdater 3.1.1
  • Pyinstaller 4.1

【问题讨论】:

    标签: python windows pyinstaller


    【解决方案1】:

    我已经删除了所有 Python 版本并从官方网站安装了一个,它现在可以工作了。 Pyinstaller 似乎无法与从 Microsoft Store 安装的 Python 一起正常工作。

    【讨论】:

      【解决方案2】:

      github issue中有解释

      1. C:\Users(username)\AppData\Roaming\Python\Python37\Scripts 添加到用户路径: 在用户变量中打开'Run' app -> Open 'sysdm.cpl' -> 'Advanced' -> 'Environment Variables' -> Edit 'path'

      2. .py 文件(保存您的python 代码的文件)复制到C:\Users(username)\AppData\Roaming\Python\Python37\Scripts

      3. 在终端运行python -m pip install pyinstaller安装pyinstaller

      4. 在终端中运行.\pyinstaller -w -F (your file name).py 将python文件转换为.exe

      现在 .exe 工具应该已经在 C:\Users(username)\AppData\Roaming\Python\Python37\Scripts\dist 文件夹中可用了。

      【讨论】:

        猜你喜欢
        • 2022-10-04
        • 2017-12-02
        • 2018-09-18
        • 2015-08-24
        • 1970-01-01
        • 1970-01-01
        • 2019-12-24
        • 1970-01-01
        • 2018-04-29
        相关资源
        最近更新 更多