virtualenv does not work under cygwin

Bug #240037 reported by kiorky
4
Affects Status Importance Assigned to Milestone
Virtualenv
In Progress
Undecided
Unassigned

Bug Description

I encountered problems while testing virtualenv under cygwin for an application port to windows.
You ll find attached a patch to make it working (it seems to).
To be honnest, i’m not a windows user and do no want to.

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

I've applied the fix for adding .exe to sys.executable. The broken copyfile seems... weird? Is this really a general cygwin problem? Wouldn't it apply elsewhere as well?

Changed in virtualenv:
status: New → In Progress
Revision history for this message
Jeff Ramnani (jefframnani) wrote :

I also get an error when running virtualenv within Cygwin. I'm running virtualenv 1.3.3dev.

Here is the error message that I get when running virtualenv in Cygwin.

$ python virtualenv.py mytest
New python executable in mytest/bin/python
Traceback (most recent call last):
  File "virtualenv.py", line 1208, in <module>
    main()
  File "virtualenv.py", line 420, in main
    unzip_setuptools=options.unzip_setuptools)
  File "virtualenv.py", line 606, in create_environment
    shutil.copyfile(executable, py_executable)
  File "/usr/lib/python2.5/shutil.py", line 46, in copyfile
    fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '/usr/bin/python'

Python's sys.executable does not have the Windows file extension included when run under Cygwin. My guess is that is what is confusing copyfile. I've noticed that Cygwin only removes the extension for '.exe' files, which is probably why you haven't noticed it in other areas of virtualenv which copy '.py', '.sh', '.bat', etc. files around.

I'm submitting a patch which I've tested on my Cygwin installation (Cygwin 1.5.25 / WinXP Professional SP2 / Python 2.5.2).

There is a thread related to this issue here, http://groups.google.com/group/python-virtualenv/browse_thread/thread/b73a0c748fd61126 . Please let me know if you want me to post there, as well.

Hope this helps, and let me know if you have any questions about the patch.

- jeff

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

Not porting to new bugtracker at https://github.com/pypa/virtualenv/issues - it appears the .exe issue is fixed, and no other issue with copyfile was ever clarified (if there is one, it would be a bug in cygwin not virtualenv).

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.