question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv environment is not activated using pipenv shell

See original GitHub issue

Environment data

  • VS Code version: 1.45.1
  • Extension version (available under the Extensions sidebar): 2020.5.80290
  • OS and version: Windows 10, build 18363
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.7, python.org
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): pipenv
  • Value of the python.languageServer setting: Microsoft

Expected 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:

  1. Set the default integrated terminal to GitBash
  2. Create new Pipenv environment
  3. Set the project interpreter to the adequate venv
  4. Open a new integrated terminal

pipenv

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

2reactions
karrtikrcommented, May 30, 2020

Perhaps https://github.com/microsoft/vscode-python/issues/8870 could also help as a workaround. Please upvote, helps bump the priority.

1reaction
karrtikrcommented, Nov 30, 2020

Should be fixed along with https://github.com/microsoft/vscode-python/issues/12020, but let’s keep this open until then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv environment is not activated using pipenv shell #16988
Using this command instead of directly running the activation script would resolve this issue.
Read more >
pipenv shell, does not activate the virtual environment
Try doing this: pip uninstall pipenv. this will uninstall existing pipenv after doing that re-install pipenv by doing this:
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an isolated environment. Uninstall all existing ......
Read more >
How to manage your python virtualenvs with Pipenv - Medium
Activate the environment. To open a shell with the already created virtualenv pipenv shell. You would see something like below:
Read more >
Configure a Pipenv environment | IntelliJ IDEA Documentation
At any time you can alter the specified path to the pipenv executable in the project settings. In the Settings ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found