Pipenv environment is not activated using pipenv shell #15745
Replies: 11 comments
-
It would also fix a broken pipenv activation if you move your project. |
Beta Was this translation helpful? Give feedback.
-
We've confirmed this issue, thanks. Although the activation works fine for me, it's better to use That being said, what if there're multiple pipenv environments in |
Beta Was this translation helpful? Give feedback.
-
Yes. |
Beta Was this translation helpful? Give feedback.
-
@JakubBlaha The problem I see with this is that, technically, there can multiple pipenv environments a workspace folder can select. For instance, Workspace folder Suppose for So the logic will not be as straightforward as simply sending Although I think in most cases, users only use one pipenv environment per workspace, but we can never know. |
Beta Was this translation helpful? Give feedback.
-
@karrtikr As from my understanding, pipenv is intended to be used with a single virtual environment and does not support creating multiple environments for a single workspace. Pipenv would refuse to create multiple environments for a single project. If a user needs to have multiple environments assigned to a single workspace, then it isn't smart to use pipenv at all, venv should be rather used. |
Beta Was this translation helpful? Give feedback.
-
I understand. I was talking about what a user is technically allowed to do. He could use pipenv environment created for some other workspace as interpreter for this one.
You'll be surprised at what our 40M userbase can attempt to do ;) |
Beta Was this translation helpful? Give feedback.
-
I understand now. I guess there should be an option of whether to use the current method of environment activation, which may be faster or the more reliable option, the |
Beta Was this translation helpful? Give feedback.
-
Perhaps #8870 could also help as a workaround. Please upvote, helps bump the priority. |
Beta Was this translation helpful? Give feedback.
-
Should be fixed along with #12020, but let's keep this open until then. |
Beta Was this translation helpful? Give feedback.
-
@JakubBlaha Actually I found out we have had some issues with using Perhaps we can use |
Beta Was this translation helpful? Give feedback.
-
Moved to #16988. |
Beta Was this translation helpful? Give feedback.
-
Environment data
python.languageServer
setting: MicrosoftExpected behaviour
When opening a new git bash terminal, the pipenv environment is properly activated.
Actual behaviour
jakub@LAPTOP-6R3A0N4R MINGW64 /d/Fiverr_28 (master) $ source C:/Users/jakub/.virtualenvs/Fiverr_28-MrJNCoYT/Scripts/activate (Fiverr_28)
which does not activate the environment properly in GitBash
Steps to reproduce:
What I suggest
Pipenv provides a really useful layer of abstraction and one of it's features is the
pipenv shell
command, which is not being used in this case. Using this command instead of directly running the activation script would resolve this issue.The issue #2559 would also be resolved by using
pipenv shell
instead of directly activating the venv.Beta Was this translation helpful? Give feedback.
All reactions