win32api needed for windows version of virtualenv2.5

Bug #344512 reported by dangyogi
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Virtualenv
Fix Committed
Undecided
Unassigned

Bug Description

Running virtualenv --no-site-packages on windows for python2.5 throws an exception on 'import win32api' because win32api is not installed. I installed python2.5 from python.org and installed virtualenv with easy_install. Perhaps a missing install_requires?

Revision history for this message
Ian Bicking (ianb) wrote :

Fixed (kind of) in r3823 -- win32api is only imported when necessary, and a better error message is provided if it is not available.

Changed in virtualenv:
status: New → Fix Committed
Revision history for this message
vulcan (alva-yi) wrote :

I also find this problem in version 1.3.3 and then I tried the trunk version from subversion, say r3910
it doesn't work as well without two slight changes, may be there are careless spelling mistake
line 643 and 647,
e.g.
pythonw = os.path.join(os.path.dirname(sys.executable, 'pythonw.exe')),
the parentheses misplaced.

Revision history for this message
Jonathan Hartley (tartley) wrote :

This is going to bite anyone working on WindowsXP in their home directory (like me repeatedly- but only today have I figured out what's going on.) If win32api is required for virtualenv to work under those circumstances, and win32api can't be automatically installed as a dependency of virtualenv since win32api isn't on PIPy (is that right?), then might it be worth:

a) mentioning this manual install dependency on http://pypi.python.org/pypi/virtualenv
b) making a small point release to include this fix, so that users who 'easy_install virtualenv' will get it.

Best regards.

  Jonathan

Revision history for this message
Steve Schmechel (steveschmechel) wrote :

I know this might be a really stupid suggestion, but let me throw it out there anyway,
and let someone bat it down. What if the "--no-site-packages" option just did *not*
apply to the win32 libraries? In other words, if they exist in the system site-packages
(meaning the system is win32 and someone installed them), just copy/link them into
the new virtualenv when it is created.

I know this risks needing to have a "--no-site-packages-not-even-win32" option, but
generally this package is going to be needed in a virtual environment on Windows and
it is hard for other packages to install it correctly. In addition, users may struggle with
getting it installed manually because the windows installer only seems to target
system-wide Python installations.

Allow me to duck at the bats start swinging. :-)

Steve

Revision history for this message
Carl Meyer (carljm) wrote :

The virtualenv docs now include a note about win32api, and the clearer error message when it's missing has long been shipped. I don't think there's justification here for a magical exception to --no-site-packages. Considering this bug resolved and not moving to the new bug-tracker at https://github.com/pypa/virtualenv/issues/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.