You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is there a way to disable / suppress pipenv's "Courtesy Notice" about virtual environments? #2527
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead.
Does PIPENV_IGNORE_VIRTUALENVS=0 have any significance? If pipenv was told to not ignore virtual envs, then that should mean I want to use my existing virtual env, and the courtesy notice should be suppressed.
@max-arnold You found a bug! lock -r should output to stdout (it does when you’re not in a virtualenv), but for some reason outputs to stderr when you are inside. You shouldn’t need more than pipenv lock --requirements > requirements.txt. We will fix that. Sorry for the annoyance.
Edit: After some testing, you should be able to run pipenv lock --requirements 2>/dev/null on Linux or Mac. No need for fancy grep-ing.
Activity
uranusjr commentedon Jul 5, 2018
No, there is not.
uranusjr commentedon Jul 5, 2018
That said, maybe we can treat an empty
PIPENV_IGNORE_VIRTUALENVSas the suppressor.PIPENV_IGNORE_VIRTUALENVSabsent—show the message.PIPENV_IGNORE_VIRTUALENVSset to empty string—suppress the message, but use the environment.PIPENV_IGNORE_VIRTUALENVSis not empty—create a nested virtualenv.trianta2 commentedon Jul 5, 2018
Does
PIPENV_IGNORE_VIRTUALENVS=0have any significance? If pipenv was told to not ignore virtual envs, then that should mean I want to use my existing virtual env, and the courtesy notice should be suppressed.techalchemy commentedon Jul 5, 2018
We have an environment variable to suppress output but we don't use it much. We can add this to the refactor
max-arnold commentedon Jul 10, 2018
My current workaround:
pipenv lock --requirements 2> >(grep -v "Courtesy Notice" >&2) > requirements.txturanusjr commentedon Jul 10, 2018
@max-arnold You found a bug!
lock -rshould output to stdout (it does when you’re not in a virtualenv), but for some reason outputs to stderr when you are inside. You shouldn’t need more thanpipenv lock --requirements > requirements.txt. We will fix that. Sorry for the annoyance.Edit: After some testing, you should be able to run
pipenv lock --requirements 2>/dev/nullon Linux or Mac. No need for fancygrep-ing.max-arnold commentedon Jul 13, 2018
@uranusjr Fancy grep and redirections are used to filter
Courtesy Noticewhile preserving stderr/stdout separation and exit codes.Add ability to suppress nested venv courtesy notice
Add ability to suppress nested venv courtesy notice