如何在MSYS2上安装python-dev?

问题描述 投票:0回答:2

我看过的帖子: 如何在MSYS2上安装Python开发工具

我尝试在 msys2 中运行 pyinstaller,但出现以下错误:

OSError: Python library not found: 
    python38.dll, libpython3.8.dll, libpython38.dll, libpython3.8m.dll, libpython38m.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)

这是我尝试使用 pacman 在 MSYS2 中安装的内容:

  • mingw-w64-x86_64-python
  • libgpgme-python
  • mingw-w64-i686-python3
  • 基础开发

不幸的是,我每次都会遇到同样的错误。我还尝试将路径变量设置为我能想到的每个可能有这些库的地方,甚至我知道的一个地方也有 libpython3.8.dll,但这没有帮助。

提前致谢!

python pyinstaller msys2
2个回答
1
投票

pip install python-dev-tools

就是我一直在寻找的。


0
投票
python-devel

包(并且仅在那里):

$ pacman -Ss 'python' | grep 'python-dev'
msys/python-devel 3.11.8-1

    https://packages.msys2.org/package/python-devel?repo=msys&variant=x86_64
  • ...但是,它似乎只是一个“元包” - 它没有任何自己的头文件等文件:

$ wget https://mirror.msys2.org/msys/x86_64/python-devel-3.11.8-1-x86_64.pkg.tar.zst ... 2024-03-23 02:53:46 (12.8 MB/s) - ‘python-devel-3.11.8-1-x86_64.pkg.tar.zst’ saved [2178/2178] $ tar tf python-devel-3.11.8-1-x86_64.pkg.tar.zst .BUILDINFO .MTREE .PKGINFO

...即使包描述提到“Python headers”:

$ tar axf python-devel-3.11.8-1-x86_64.pkg.tar.zst .PKGINFO -O # Generated by makepkg 6.0.2 pkgname = python-devel pkgbase = python pkgver = 3.11.8-1 pkgdesc = Python headers and dev dependencies url = https://www.python.org/ builddate = 1707778846 packager = CI (msys2/msys2-autobuild/d4515ba2/7879011349) size = 0 arch = x86_64 license = custom depend = python=3.11.8 makedepend = libbz2-devel makedepend = libxcrypt-devel makedepend = libexpat-devel makedepend = mpdecimal-devel makedepend = libsqlite-devel makedepend = libffi-devel makedepend = ncurses-devel makedepend = libreadline-devel makedepend = liblzma-devel makedepend = openssl-devel makedepend = zlib-devel makedepend = autotools makedepend = autoconf-archive makedepend = gcc

所以,我不确定这个包的确切用途是什么 - 即使没有安装它,我也可以完成一些构建......

© www.soinside.com 2019 - 2024. All rights reserved.