davidmarble / virtualenvwrapper-win

Port of Doug Hellmann's virtualenvwrapper to Windows batch scripts
Other
461 stars 106 forks source link

1.1.3 won't install via pip or source #32

Closed hobbsd closed 11 years ago

hobbsd commented 11 years ago

1.0.9 worked for me, but the install via pip only installs the "virtualenvwrapper_win-1.1.3-py3.3.egg-info" dir -- no scripts. And the source install using python setup.py install fails with: "error: file 'C:\Users\dhobbs\scripts\add2virtualenv.bat' does not exist" (C:\Users\dhobbs was my current dir).

This is on Win7-64 using Python 2.7 and 3.3.

davidmarble commented 11 years ago

The scripts install to the base directory of the active python installation. So if pip found on your path is actually C:\Python27\Scripts\pip.exe, the scripts will be installed in C:\Python27. Previously they were installed in the Scripts directory; I've moved them to the python root directory for 2 reasons:

  1. For some people the root python directory is the only python directory they want on their PATH. (It contains python.exe and pythonw.exe)
  2. If you're using a python switcher, such as py or my own [pywin](https://github.com/davidmarble/pywin), when you switch python versions it's bad news to have more than one Scripts\ directory from separate python versions on the PATH. So taking pywin as an example, when you switch python versions I leave the default python root directory on the PATH, but remove the Scripts directory if it's on the PATH, then I put the new python version's root and Scripts directories at the front of the PATH.

Illustrating further... If your PATH starts out as

C:\Windows;C:\Python27;C:\Python27\Scripts

and you run

C:\> pywin setdefault 3.3

the PATH will now be:

C:\Python33;C:\Python33\Scripts;C:\Windows;C:\Python27

So it's best if virtualenvwrapper-win scripts are in C:\Python27

hobbsd commented 11 years ago

I see -- I didn't think to look in the Python root directory for the scripts. I'm using the py launcher that comes with Python3.3, and I add my Python 2 and 3 Scripts directories to PATH with 2 coming first, which has been working pretty well for me. I guess I'll just move the .bat files to my Scripts dir.

On a related note, though, pip doesn't uninstall the .bat files on uninstall of virtualenvwrapper-win, just the .egg-info.

Anyway, thanks for creating this port -- it's a real boon.

davidmarble commented 11 years ago

I've made a few needed fixes, and the project now supports pip uninstall virtualenvwrapper-win.

I've kept the installation putting the scripts in the root python folder for the reasons above. You should be able to install virtualenvwrapper-win whether or not you have a Scripts\ directory on your PATH. Feel free to try it out and give more feedback.

davidmarble commented 11 years ago

Oh, I'll update pypi in the next day.