thisismedium / virtualenv-commands

Additional commands to augment the python virtualenv package.
http://thisismedium.com/labs/virtualenv-commands/
BSD 2-Clause "Simplified" License
37 stars 7 forks source link

Internal use of 'which' program raises exception under Windows #6

Open piotr-dobrogost opened 13 years ago

piotr-dobrogost commented 13 years ago

When running this command C:\Documents and Settings\pdobrogost>python c:\Python\2.7\Scripts\ve-init I get this execption

Traceback (most recent call last):
  File "c:\Python\2.7\Scripts\ve-init", line 19, in <module>
    main(*sys.argv[1:])
  File "c:\Python\2.7\Scripts\ve-init", line 16, in main
    return vecmd.virtualenv(*args)
  File "c:\python\2.7\lib\site-packages\vecmd\commands.py", line 71, in virtualenv
    return script.python(script.which('virtualenv'), '-q', *args)
  File "c:\python\2.7\lib\site-packages\vecmd\script.py", line 127, in which
    return capture('which', *args).strip()
  File "c:\python\2.7\lib\site-packages\vecmd\script.py", line 105, in capture
    return subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
  File "c:\python\2.7\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "c:\python\2.7\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Printing args at line 105 of script.py shows vecmd tries to execute which program which is not available on Windows. On newer versions of Windows there's equivalent called where - see http://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-windows

piotr-dobrogost commented 13 years ago

Anybody here?

dragon788 commented 9 years ago

@piotr-dobrogost This probably needs to use where or whereis instead of which, but I'm not positive, it looks like you are on the right track.