views:

285

answers:

3

I'm working with PyInstaller under Python 2.6, which is only partially supported due to the mess MS have created with their manifest nonense which now affects Python since it is now MSVC8 compiled.

The problem is that the manifest embedding support relies on the pywin32 extensions in order to build which is a pain because without including the host's site-packages folder when I create the virtualenv (kinda defeats the point in a build environment) I cannot find a way to install the required extensions so they are accessible to PyInstaller.

Has anyone found a solution to this issue?

A: 

OK, well since I had to find a way forward I improvised. I've internally created a git repository with a hacked-together version of pywin32 that will install within a virtualenv using the standard setup.py script. It took a lot of fiddling to make it work right but I managed to get it to load and the dependent code now works as I need it to. If people feel this would be of benefit to the community please post a comment: if I get enough I'll try and put something up on my github account.

jkp
A: 

I could definitely use your modified pywin32 install

Jack Lunn
@Jack: OK, I'll see what I can do today. Not sure what the licensing is though...
jkp
@Jack: Try this - http://github.com/jkp/pywin32. The license seems to allow me to do this as long as I make my efforts public. I warn you: I don't think my distribution is complete: I only did what I needed to for my code to work. Try it and let me know.
jkp
+1  A: 

I found http://old.nabble.com/Windows:-virtualenv-and-pywin32--td27658201.html which offered the following solution, which worked for me.

  1. Download the latest pywin32 installer from http://sourceforge.net/projects/pywin32/

  2. Activate your virtualenv

  3. Run easy_install blah.exe where the path matches your downloaded file

The same page offers a similar solution which didn't work for me, namely running

easy_install http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pywin32-214.win32-py2.6.exe/download

I got the following error:

error: c:\users\blah\appdata\local\temp\easy_install-ibkzv7\pywin32-214.win32-py2.6.exe is not a valid distutils Windows .exe

This could be because I am using Distribute rather than the original setuptools easy_installer, but I prefer Distribute and am not going to install original setuptools just for this.

I rather hopefully tried "pip install" rather than "easy_install", this also didn't work.

Finally, I found but haven't tested the solution at http://www.mail-archive.com/[email protected]/msg272040.html which is:

Solved this by copying the pywin32.pth file into my virtualenv site-packages and editing the file to point to the path.

If the others don't work for you, maybe this will?

d3vid