How to obtain pre-built *debug* version of Python library (e.g. Python27_d.dll) for Windows
Asked Answered
U

3

13

Firstly, I should state that my current development environment is MSYS + mingw-w64 + ActivePython under Windows 7 and that on a normal day I am primarily a Linux developer. I am having no joy obtaining, or compiling, a version of the Python library with debug symbols.

I need both 32bit and 64bit debug versions of the Python27.dll file, ideally. I want to be able to embed Python and implement Python extensions in C++, and be able to call upon a seamless debugging facility using the gdb-7.4 I have built for mingw-w64, and WingIDE for the pure Python side of things.

Building Python 2.7.3 from source with my mingw-w64 toolchain is proving too problematic -- and before anyone flames me for trying: I acknowledge that this environment is unsupported, but I thought I might be able to get this working with a few judicious patches (hacks) and:

make OPT='-g -DMS_WIN32 -DWIN32 -DNDEBUG -D_WINDOWS -DUSE_DL_EXPORT'

I was wrong... I gave up at posixmodule.c since the impact of my changes became uncertain; ymmv.

I have tried building with Visual C++ 2010 Express but being primarily a Linux developer the culture-shock is too much for me to bear today; the Python project does not even import successfully. Apparently, I need Visual C++ 2008, yet I am already convinced I don't want to go down this road if at all possible...

It's really surprising to me that there is not a zip-file providing the requisite .dlls somewhere on the Internet. ActiveState should really provide these as an optional download with each release of ActivePython that they make -- perhaps that's where the paid support comes in ;-).

What is the best way to obtain the Python debug library files given my environment?

Uranium answered 25/4, 2012 at 12:31 Comment(1)
The debugging builds are available together with the "normal" builds from the python.org/ftp/python file server.Spinach
B
7

I've just built CPython 2.7.5 in debug mode with Visual Studio 2012 Express (free).

I documented the process via wiki page: https://wiki.python.org/moin/VS2012

Bhakti answered 5/10, 2013 at 23:28 Comment(0)
O
4

The best way to create a debug version of Python under Windows is to use the Debug build in the Visual Studio projects that come with the Python source, using the compiler version needed for the specific Python release, i.e. VS 2008.

There may be other ways, but this is certainly the best way.

If you really need a 64-bit debug build also, the best way is to buy a copy of VS 2008 (i.e. not use the Express version). It may be possible to create an AMD64 debug build using the SDK 64-bit compiler, but again, using the officially-supported procedures is the best way.

Oleneolenka answered 25/4, 2012 at 20:55 Comment(0)
S
0

The libs can be aquired from the official Python site https://www.python.org/ftp/python/. Just navigate to the specific version you like and then download the respective installer.
For installation you can call the installers like this :

your_installer.msi targetdir="the_path_to_your_directory_of_choice"

or simply Run them as Administrator.

You may also use the Python installer to download the debug symbols as well(use the webinstall version).

Stereoscopy answered 7/11, 2020 at 7:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.