-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
venv: activate.bat fails for venv with parentheses in PATH #80815
Comments
After creating a virtual environment on win 7 (64bit) with: Running venv\Scripts\activate.bat will yield this result: My PATH variable contains a path that starts with: To me this looks like this issue for virtualenv: Running: This is my default python on PATH. Doing this with virtualenv: I really hope this is not a duplicate. |
Basically everyone has that directory in their PATH - we'd be hearing a lot more issues if it were a consistent bug. Can you share the full contents of your activate.bat file? And if it's okay, your full PATH variable (before and after running activate.bat) (You may not want to share PATH if there are applications in there that you don't want to be seen publicly - in that case, can you randomize letters rather than deleting them? e.g. "System32"->"Xborpm99" That way we won't lose potentially important information to this bug like punctuation.) |
I have attached the activate.bat script that got generated by venv. My current path looks like this (added line breaks for readability): C:\Program Files\Git\bin; %IBISUROOT%=C:\Program Files (x86)\Koenmdpk\ibisu\ |
So if I replace this section from venv's activate.bat: with the part from virtualenv's activate.bat: REM if defined _OLD_VIRTUAL_PATH ( then venv\Scrtips\activate.bat seems to behave as expected. |
Ok I think I found my problem. The system path of of my machine is ok but my user path contains a stray double quotation mark (") like this: C:\Program Files\Git\bin";C:\Tools\antlr;C:\Program Files (x86)\Common Files\Oracle\Java\javapath ... With this I am closing the double quotation of the .bat file too early and this leads to an early closing ). If I remove it venv\Script\activate.bat behaves as expected. Sorry for taking up your time. |
Steve, do you think we should work around this by first removing double quote characters from PATH? This will fix the user's PATH, making one or more directories searchable again, but it could have side effects. |
We should be able to use alternate characters in the SET call, or just drop the quotes completely. In theory they make sense, but there's no trailing whitespace to worry about here. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: