-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
pipenv shell does not work when running Git for Windows' bash on Windows #2623
Comments
I’m not very familiar with Git Bash (i.e. Msys Bash), so some help would be appreciated. Does this need to be in |
Gladly. I tested cygwin too now. CygwinHas the exact same failure for both
This does not work either, even if Edit: Cygwin also gives the following error
Where the real windows path for
Answer
MsysMsys pretends to be unix. So everything is in Answer
AdditionalI forgot to mention this before, but |
For Cygwin—are you using the Cygwin Python, or using CPython’s standard Windows distribution inside Cygwin? Those are totally different, but I’d imagine Pipenv should work in the former case. The latter case is much more difficult, unfortunately (but maybe Python used in this context has the same characteristics as in Msys, and can be addressed similarly). For Msys, the problem is difficult. Python does not know it is being run inside Msys, so we’ll need to do some poking ourselves. There are a few opportunities…
Maybe a combination like (1 or 2) and 3 would be the way to go. |
Some notes (after poking around with a VM):
So we only need to worry about Msys2 (I don’t want to care about Msys1, but they should be similar). Msys Python works similarly as Cygwin Python, and Pipenv functions correctly out of the box afaict, no problem here. Python for Windows in Msys is the worst. Python identifies the system as Windows, and even
The second option is intriguing, but I think I will go for the first. It is more straightforward and safer. Finally, I don’t think we need to fix If I’ve learnt any life lessons from this adventure, it’s that both Msys and Cygwin are only work people who know what they are doing. Do not ever teach them to beginners, or they will hit a wall when the abstraction inevitably breaks. If you want Git on Windows, use it in cmd.exe or Powershell. Git Bash is as bad an option as you can get. I’d choose WSL all day every day. |
@uranusjr I agree then, let cygwin be. For the record, I was always using cpython. Honestly, I think option 3 is the best (or another variable name if that's the correct way to go). It would cover anyone else's corner case, without requiring pipenv to be knowledgeable about the different systems. I kind of agree that using the msys/cygwin can lead to issues. But long story short, I have a bunch of scripts that I maintain and writing them in ps/batch too was just too much (tried it). And running in WSL won't work for the software I use :( |
You do know what you’re doing, however, so if it works, let it be! It’s lucky for us you file this first before some random folk come yelling because things don’t work ;) I did implement a |
Issue description
Running
pipenv shell
on windows when running bash in Git for Windows does not activate the virtual env successfully. It appears the actual activate script with the correct values is not being used.Expected result
I would successfully be in the virtualenv
Actual result
The
VIRTUAL_ENV
andPATH
variables are in theC:
notation instead of/c/
notation which would have worked.Sourcing the virtualenv activate variable does work, even though Git for Windows uses
msys
and notcygwin
. Did not test cygwinSteps to replicate
pipenv install sphinx
echo $$
pipenv shell
echo $$
pip freeze
echo $PATH
Shows that the pip environment is the original python environment, not the virtualenv. The different pid verifies that a new shell is indeed being run, but the virtualenv is not activating
Also tried
PIPENV_EMULATOR=bash pipenv shell
Identical results
$ pipenv --support
Pipenv version:
'2018.7.1'
Pipenv location:
'c:\\python37\\lib\\site-packages\\pipenv'
Python location:
'c:\\python37\\python.exe'
Other Python installations in
PATH
:3.7
:C:\Python37\python.exe
3.7.0
:C:\Python37\python.exe
3.7.0
:C:\Windows\py.exe
PEP 508 Information:
The text was updated successfully, but these errors were encountered: