简体   繁体   中英

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:
  • environment path of Step 2 to "python.pythonPath":
  • folder names to prevent pylance yellow squigglies to "python.analysis.extraPaths":
  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 ?

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

    在此处输入图片说明

  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:

    在此处输入图片说明

    After:

    在此处输入图片说明

The pipenv version I use is 2020.11.4 .

Update:

在此处输入图片说明

Entering the command set PIPENV_VERBOSITY=-1 didn't work for me.

So I added PIPENV_VERBOSITY variable and set the value to -1 in the environment variable window

Setting Environment Variables:

  1. Right-click on My Computer or This PC and select Properties .
  2. Go to the Advanced system settings or Go to the Advanced tab in the System Properties window
  3. Click the Environment Variables button. The Environment Variables dialog opens.
  4. Click the New button under either User variables or System variables, depending on whether you want to set the variable for the current user or all users. To set environment variables for all users, you need to have administrator privileges.
  5. In the Variable name field, enter the name of the environment variable you want to set. For a list of the environment variables that Nuke understands, see Nuke Environment Variables.
  6. In the Variable value field, enter the value for the variable. The value can be a directory path, for example.
  7. Click OK.

环境变量窗口

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM