reservoirinvest
reservoirinvest

Reputation: 1777

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 ?

Upvotes: 3

Views: 4160

Answers (3)

joshgalv
joshgalv

Reputation: 170

On Mac or Linux you can run export PIPENV_VERBOSITY=-1 and for that terminal process PIPENV_VERBOSITY will be set to -1. If you want to set this globally you can open your ~/.zshrc (or .bashrc, .etc) and write export PIPENV_VERBOSITY=-1 on a new line anywhere in there. Save and exit and now any terminal you have should have this environment variable set.

Upvotes: 0

Pedram Elmi
Pedram Elmi

Reputation: 389

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.

Environment Variables Window

Upvotes: 0

Jill Cheng
Jill Cheng

Reputation: 10354

  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

Upvotes: 3

Related Questions