【问题标题】:pyinstaller causes OSerrorpyinstaller 导致 OSerror
【发布时间】:2021-09-23 13:17:46
【问题描述】:

我运行pyinstaller test.py 并收到以下错误。

OSError: Python library not found: Python3, Python, libpython3.9.dylib, libpython3.9m.dylib, .Python
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)

我试过brew install python3-devbrew install python-dev

==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

我运行了以下命令,但它们都导致了相同的错误:brew reinstall python,PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.0,PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.9.0

卸载和安装 pyinstall 不起作用。 有人知道吗?

以下是以下命令的结果:

which pyinstaller
/Users/user/.pyenv/shims/pyinstaller
which python
/Users/user/.pyenv/shims/python

【问题讨论】:

  • 我遇到了同样的问题。我正在使用 msys

标签: python pyinstaller oserror


【解决方案1】:

我认为pyenv 可能无法使用您需要的标志第二次安装 3.9.0。

我让它工作的方法是卸载我想使用的python版本,然后用这个命令重新安装它:

env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.10.2

然后为了激活正确的版本,我必须运行:

pyenv rehash

否则,我无法让我的系统“看到”新安装的版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-27
    • 1970-01-01
    • 2021-11-24
    • 2019-08-18
    • 2018-01-22
    • 1970-01-01
    相关资源
    最近更新 更多