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
Install bash activate script on Windows when using venv #66539
Comments
When I use venv to create a new virtual environment in Windows I'm given two activate scripts, a .bat file and a .ps1 file (which is consistent with the documentation). However, bash (and probably the other shells as well) works just fine in Windows under Cygwin. Since you have these scripts anyway, please include them in the Windows virtual environment (as virtualenv did). |
+1 from me - Vinay? |
I have no particular objection to this, and it's not a lot of work to make it happen. The POSIX scripts were left out in case the opposite view was advanced - that these scripts would be of no use to most people on Windows, and shouldn't be there cluttering up the place :-) |
Presumably this would just be a case of moving "activate" from venv/scripts/posix to venv/scripts/common? I don't think including csh or fish scripts on Windows is worthwhile... Attached is a patch on that basis. I didn't see any tests for which scripts were installed, so I don't think there's anything to change there. |
+1 just experienced this issue migrating from Python3.4 to Python3.5 on windows with bash (MINGW git bash) as primary shell Temporarily resolved issue (on this workstation) by simply copying Python35\Lib\venv\scripts\posix\activate file, into folder: Python35\Lib\venv\scripts\nt\ then recreating venv |
+1, I'm also using Windows with Git Bash and venv is unusable for me without Brandon's workaround. |
If we do this, the activate script will have LF (POSIX) line endings on Windows. Will this work for things like cygwin, Git-bash etc? |
I can confirm that LF endings work fine on Cygwin, and it's hard to imagine any bash implementation not handling that properly. |
Works for me in Git Bash. |
I've pushed the changes, but due to some SMTP problem this issue wasn't updated by Roundup: remote: SMTPServerDisconnected: Connection unexpectedly closed: timed out However, the changes appear to be in the repository. Interested parties might want to pull the changes and test things out on Windows so that the issue can be closed. |
Changesets: 3.5 d6ae934da199 |
Works for me on the master branch. Thanks, Vinay. |
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: