pipenv detects itself running in a virtual env even though there isn't one
See original GitHub issueWhenever I create a new directory and run pipenv install there it says:
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. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
This, despite the fact that it’s a freshly opened terminal window in a newly created directory and I’m quite sure pipenv is not running inside a virtual environment.
To top it off, it apparently then does create a new virtual environment even though it says it wouldn’t…?
toni@Tonis-MacBook-Pro ~ % mkdir test3
toni@Tonis-MacBook-Pro ~ % cd test3
toni@Tonis-MacBook-Pro test3 % pipenv install --verbose --verbose
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. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Using python: None
Path to python: /usr/local/bin/python3
Creating a virtualenv for this project…
Pipfile: /Users/toni/test3/Pipfile
Using /usr/local/bin/python3 (3.7.7) to create virtualenv…
⠸ Creating virtual environment...created virtual environment CPython3.7.7.final.0-64 in 837ms
  creator CPython3Posix(dest=/Users/toni/.local/share/virtualenvs/test3-_bIlMMXE, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/toni/Library/Application Support/virtualenv/seed-app-data/v1.0.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
✔ Successfully created virtual environment! 
Virtualenv location: /Users/toni/.local/share/virtualenvs/test3-_bIlMMXE
Creating a Pipfile for this project…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (a65489)!
Installing dependencies from Pipfile.lock (a65489)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
toni@Tonis-MacBook-Pro test3 % 
$ pipenv --support
Pipenv version: '2020.6.2'
Pipenv location: '/usr/local/Cellar/pipenv/2020.6.2/libexec/lib/python3.8/site-packages/pipenv'
Python location: '/usr/local/Cellar/pipenv/2020.6.2/libexec/bin/python3.8'
Python installations found:
- 3.7.7:- /usr/local/bin/python3
- 3.7.7:- /usr/local/bin/python3.7m
- 3.7.7:- /usr/local/bin/python3.7
- 3.7.3:- /usr/bin/python3
- 2.7.16:- /usr/bin/python2
- 2.7.16:- /usr/bin/python2.7
PEP 508 Information:
{'implementation_name': 'cpython',
 'implementation_version': '3.8.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '19.5.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT '
                     '2020; root:xnu-6153.121.2~2/RELEASE_X86_64',
 'python_full_version': '3.8.3',
 'python_version': '3.8',
 'sys_platform': 'darwin'}
System environment variables:
- PATH
- TERM_PROGRAM
- SHELL
- TERM
- CLICOLOR
- TMPDIR
- TERM_PROGRAM_VERSION
- TERM_SESSION_ID
- USER
- SSH_AUTH_SOCK
- _
- PWD
- XPC_FLAGS
- XPC_SERVICE_NAME
- SHLVL
- HOME
- LOGNAME
- LC_CTYPE
- __CF_USER_TEXT_ENCODING
- PIP_DISABLE_PIP_VERSION_CHECK
- PYTHONDONTWRITEBYTECODE
- PIP_SHIMS_BASE_MODULE
- PIP_PYTHON_PATH
- PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
- PATH:- /usr/local/Cellar/pipenv/2020.6.2/libexec/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
- SHELL:- /bin/zsh
- PWD:- /Users/toni/test3
Contents of Pipfile (‘/Users/toni/test3/Pipfile’):
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "3.7"
Contents of Pipfile.lock (‘/Users/toni/test3/Pipfile.lock’):
{
    "_meta": {
        "hash": {
            "sha256": "7e7ef69da7248742e869378f8421880cf8f0017f96d94d086813baa518a65489"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:39
- Comments:37 (5 by maintainers)

 Top Related Medium Post
Top Related Medium Post Top Related StackOverflow Question
Top Related StackOverflow Question
I removed pipenv from brew then reinstalled pipenv via pip3 and all is good now.
Rolling back to the previous version fixes it for me:
$(brew --cellar)/pipenv/2020.6.2/libexec/bin/pip install pipenv==2020.5.28