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).
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 setuptools= options. unzip_setuptool s) copyfile( executable, py_executable) python2. 5/shutil. py", line 46, in copyfile
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_
File "virtualenv.py", line 606, in create_environment
shutil.
File "/usr/lib/
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/ b73a0c748fd6112 6 . 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