Skip to content

Pipenv not activated and pipenv command not used #14829

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

Closed
josephgruber opened this issue Nov 26, 2020 · 5 comments
Closed

Pipenv not activated and pipenv command not used #14829

josephgruber opened this issue Nov 26, 2020 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@josephgruber
Copy link

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"

@josephgruber josephgruber added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Nov 26, 2020
@josephgruber
Copy link
Author

Possibly related to #14828

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Nov 30, 2020
@karrtikr
Copy link

Should be fixed along with #12011

@ghost ghost removed the triage label Nov 30, 2020
@josephgruber
Copy link
Author

Is #12011 fixed though @karrtikr? Looks like that's still open.

@karrtikr
Copy link

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

@josephgruber
Copy link
Author

Just saw your comment on 12011. Thanks.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants