Re: [pywin32-bugs] Building PyWin32 into Python as built-in
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@sk...> - 2017-10-03 00:00:07
|
This isn't the correct list - try the python-win32 mailing list. You need to be subscribed to the list before you can post to it - see http://mail.python.org/mailman/listinfo/python-win32 for subscription options. However, I don't believe it will be possible to build pywin32 as a buitin module - for one thing, there's really no single module named "pywin32" - there are lots of modules, and many of the features simply will not work. You might be able to get it working for some modules, but I suspect it will take some significant hacks that will not be accepted back into the tree. You should consider mailing the python-win32 list with the underlying problems causing you to believe this is the solution and see if they have alternative solutions. Cheers, Mark On 3/10/2017 7:39 AM, A wrote: > Hello, > > I need some assistance please regarding building PyWin32. I hope that > this is the correct mailing list to ask this, but if not, please direct > me to the right place. I'm wondering if it's possible to build PyWin32 > into Python as a built-in module? I would like to do this with Python > 2.7.13 64-bit for Windows. I have Microsoft Visual Studio 2008 and VS > 2010 Service Pack 1 installed, and I have built Python from the source > code with "pcbuild.sln". I found that most of the modules distributed > with Python can be made to be built-in by changing the module's project > type to be "Static library (.lib)" rather than a DLL project, adding > "Py_BUILD_CORE;Py_NO_ENABLE_SHARED;" to the module project's > preprocessor directives, changing the project references so that the > "pythoncore" project refers to the module's project rather than the > module's project referring to "pythoncore", and adding corresponding > lines for the module in "PC\config.c" (in the "pythoncore" project). > (There are a few more steps/hacks needed for some of the modules, but > that is the basic process.) I can do this because the modules > distributed with Python ("bz2", "_ctypes", etc.) are Visual Studio > projects. However, PyWin32 is much different because it is built with > Python Distutils and a "setup.py" script, not a Visual Studio > project/solution. Usually, PyWin32 would be built with the command > "python setup.py {build|install}". I have tried playing with > command-line options to no avail thus far. I have also tried including > all of the .c, .cpp, .cxx, .h, etc. files from the PyWin32 source > directories into the "pythoncore" Visual Studio project, but this didn't > end up working. I figure that I would need to do one of two things: > either (a) the PyWin32 modules need to be built as static library (.lib) > files rather than .pyd files somehow, and "pythoncore" needs to link to > those .lib files (like I did with the modules distributed with Python), > or (b) I need to include PyWin32's source files into the "pythoncore" > project somehow (and the way that I tried it was incorrect for some reason). > > Can someone please provide guidance as to how I can properly build > PyWin32 into Python as a built-in module? Is there a quick way of doing > this, or would it take an entire overhaul of all of PyWin32's source > code to accomplish this? > > Thank you! > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > pywin32-bugs mailing list > pyw...@li... > https://lists.sourceforge.net/lists/listinfo/pywin32-bugs > |