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 not activated and pipenv command not used

See original GitHub issue

Environment data

  • VS Code version: 1.51.1
  • Extension version (available under the Extensions sidebar): v2020.11.371526539
  • OS and version: Mac OS 10.5.7 (Catalina) and Mac OS 11.0.1 (Big Sur)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.5, 3.8.6, 3.9.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): Pipenv
  • Relevant/affected Python packages and their versions: pipenv v2020.11.15
  • Relevant/affected Python-related VS Code extensions and their versions: Python v2020.11.371526539 or Pylance v2020.11.2
  • Value of the python.languageServer setting: Jedi or Pylance

Expected behaviour

When working in a Pipenv environment, the Pipenv virtual environment would be activated and pipenv install would be used for any installations instead of pip

Actual behaviour

The virtual environment is activated but Pipenv is not and pipenv commands are not used, only pip commands.

Steps to reproduce:

  1. Create a new project directory
  2. Initialize a new Pipenv environment using pipenv install
  3. Open the project directory in VS Code
  4. Choose “Select Interpreter” from the command palette and select the virtual environment interpreter (e.g. ./.venv/bin/python)
  5. Exit VS Code
  6. Re-open the project directory in VS Code
  7. Open or create a Python file to trigger automatic linting or formatting. When prompted to install a formatted or linter in the new virtual environment, click Install.
  8. VS Code will open a terminal, activate the virtual environment and then run a pip install -U package_name

Logs

Output from Terminal

source /Users/josephgruber/Desktop/vscode_pipenv_test/.venv/bin/activate
/Users/josephgruber/Desktop/vscode_pipenv_test/.venv/bin/python /Users/josephgruber/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py pip install -U bandit

Output for Python in the Output panel

User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonInstallFlake8ButtonFirst'
> conda --version
> conda info --json
> python3.7 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Starting Jedi Python language engine.
Python interpreter path: ./.venv/bin/python
> conda --version
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py site --user-site
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py site --user-site
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/completion.py
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/completion.py
Error 2020-11-26 12:14:27: stderr jediProxy Error (stderr) /Users/josephgruber/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/completion.py:584: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
  jedi.api.names(

> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py bandit -f custom --msg-template {line},0,{severity},{test_id}:{msg} -n -1 ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py bandit -f custom --msg-template {line},0,{severity},{test_id}:{msg} -n -1 ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py flake8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py flake8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py mypy --ignore-missing-imports --follow-imports=silent --show-column-numbers ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py mypy --ignore-missing-imports --follow-imports=silent --show-column-numbers ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/Desktop/vscode_pipenv_test/test.py
cwd: ~/Desktop/vscode_pipenv_test
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import bandit"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import bandit"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import flake8"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import flake8"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import mypy"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import mypy"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pycodestyle"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pycodestyle"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pylint"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pylint"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import bandit"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import bandit"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import flake8"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import flake8"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pycodestyle"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pycodestyle"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import mypy"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import mypy"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pylint"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pylint"

Linter 'bandit' is not installed. Please install it or select another linter".
Error: Module 'bandit' not installed.

Linter 'flake8' is not installed. Please install it or select another linter".
Error: Module 'flake8' not installed.

Linter 'pycodestyle' is not installed. Please install it or select another linter".
Error: Module 'pycodestyle' not installed.

Linter 'mypy' is not installed. Please install it or select another linter".
Error: Module 'mypy' not installed.

Linter 'pylint' is not installed. Please install it or select another linter".
Error: Module 'pylint' not installed.
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pip"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import pip"
> ~/Desktop/vscode_pipenv_test/.venv/bin/python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import bandit"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Nov 30, 2020

I closed this as dup of that. We only need to track it in one place.

0reactions
josephgrubercommented, Nov 30, 2020

Just saw your comment on 12011. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pipenv: Command Not Found - Stack Overflow
2. In command Prompt (cmd) enter PATH and check in output if the c:\users\test\appdata\roaming\python\python36\Scripts or ...
Read more >
Solving `command not found: pipenv` - Koen Woortman
Configure your shell PATH environment variable to to solve the error where pipenv is not found.
Read more >
pipenv is not recognized as an internal or external command
The error "'pipenv' is not recognized as an internal or external command, operable program or batch file" occurs when we forget to install...
Read more >
Installing pipenv on a Mac: command not found! - Python
First I actually uninstalled Python, then reinstalled it in its own directory, making sure to select the 'add to PATH' and 'install pip'...
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 >

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