Alex Eastman
Alex Eastman

Reputation: 395

How to install python-dev on MSYS2?

Posts I've viewed: How to Install Python Development Tools on MSYS2

I'm trying to run pyinstaller in msys2, but I'm getting the following error:

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)

Here's what I've tried installing in MSYS2 using pacman:

Unfortunately, I get the same error every time. I've also tried setting my path variable to every place I could think of that might have these libraries, and even one spot that I know has libpython3.8.dll but it was no help.

Thanks in advance!

Upvotes: 3

Views: 2956

Answers (2)

sdbbs
sdbbs

Reputation: 5394

Just some more detail - note that there is in fact a python-devel package in MSYS2 (and only there):

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

... however, it seems it is just a "metapackage" - it does not have any header, etc files of its own:

$ 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

... even if the package description mentions "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

So, I'm not sure exactly what the utility of this package is - I could have done some builds, even without it installed ...

Upvotes: 0

Alex Eastman
Alex Eastman

Reputation: 395

It looks like
pip install python-dev-tools
was what I was looking for.

Upvotes: 3

Related Questions