pythonvisual-studio-codepipenvpython-venv

Setting pipenv environment variable in venv


I am trying to set up a Python virtual environment with pipenv. In VS Code, started in a fresh directory of Windows 10 OS, after doing:

  1. python -m venv work_env in the Terminal
  2. Noting the path of the Script folder within work_env
  3. Doing Ctrl-Shift-P and Preferences: Open Workspace Settings
  4. In settings.json, adding:
  1. Doing a pipenv install in the Terminal
  2. Updating package names in Pipfile
  3. Doing pipenv update in the Terminal

... There comes a Courtesy Notice: Pipenv found itself running within a virtual environment, ... You can set PIPENV_VERBOSITY=-1 to suppress this warning.

In what folder / file / configuration do I set this PIPENV_VERBOSITY=-1 ?


Solution

    1. According to the information you provided, I reproduced the problem you described:

      enter image description here

    2. The reason is as this 'Courtesy Notice', "pipenv install" is to create a virtual environment for the current project, and we have created a virtual environment "work_env", so it prompts us to ignore this environment or Suppress this warning.

    3. We can directly enter the command "set PIPENV_VERBOSITY=-1" in the console to suppress this warning:

      enter image description here

      After:

      enter image description here

    The pipenv version I use is 2020.11.4.

    Update:

    enter image description here