Open jeflopodev opened 9 years ago
It should be sufficient to use "%PYHOME%\Scripts\virtualenv.exe" %ARGS%
(it's an executable..)
%PATH%
is in relation to finding the virtualenvwrapper .bat files, %WORKON_HOME%
is where your virtualenvs will be stored. %PYHOME%
is either copied from PYTHONHOME
or sys.exec_prefix
and should point to the directory containing python.exe
(users should never need to change this to accommodate this project).
The intention of the outer if is to figure out where the virtualenv
package placed its entry point, so we can call it, but perhaps we shouldn't worry and just use:
virtualenv %ARGS%
and leave it up to the user to fix their environment variables..? Most users can probably run virtualenv
already so this shouldn't cause problems.
Looking at it (https://github.com/pypa/virtualenv/blob/master/setup.py) a bit closer, virtualenv can place its entry point in different locations depending on the presence of the setuptools
package.
Possible solutions..
if
and just use virtualenv %ARGS%
as explained abovevirtualenv
virtualenv.xxx
(e.g. https://github.com/datakortet/dkfileutils/blob/master/dkfileutils/which.py)%VIRTUALENV_EXECUTABLE%
)I don't have a strong opinion either way (but the environment variable override might be a good idea regardless of what else is chosen).
mkvirtualenv.bat wasn't working for me till I have modified a path in its code.
I'm Using:
Default UAC Settings.
My %PATH% (not modified manually):
My %WORKON_HOME%:
My %PYHOME%:
I have modified the else path part (lines 49 to 53) of mkvirtualenv.bat:
My
*.bat
scripts was installed in my base prefix,C:\python34
and not inC:\python34\
And this is why it wasn't working.I don't know If this is just a workaround or the way to go. But a point, de documentation says to setup
%PATH%
and%WORKON_HOME%
, but the code uses%PYHOME%
Shouldn't be the code be using one or the other but not both env vars ? :$I also think that's very ugly the
python.exe "%PYHOME%\Scripts\virtualenv.exe" %ARGS%
call. Calling an exe from another exe xd But this is my fault Heheworkon, deactivate, rmvirtualenv & lsvirtualenv commands work fine after this change.