-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pipenv detects itself running in a virtual env even though there isn't one #4327
Comments
Can you confirm whether it still happens with pipenv@master? |
FWIW I'm also seeing this with version Assuming https://pipenv-fork.readthedocs.io/en/latest/_modules/pipenv/environments.html#is_in_virtualenv is supposed to be the correct form for
I'll try with a non-brew-install pipenv using the master branch. |
I am also using this with the Homebrew build, so it's possible that's a common link |
I tried to run If there are instructions for running from |
Same here. pipenv homepage recommends homebrew to install it, isn't the latest brew supported? |
On closer inspection looks like a duplicate of #4316 |
@acdha @ianchesal To be more clear Reference: https://bugs.python.org/issue22490 |
+1 for this with pipenv, version 2020.6.2 installed via Homebrew |
+1, on Mac OS X. I have installed pipenv via ** edit ** : Seems, however, to be fixed on master: Install via: |
For me, installing the
|
I can confirm - tested on two different macOS machines with 3.7 and 3.8 - that it is not restricted to machines with Homebrew. On one machine I had Homebrew installed but removed it totally after a short while (and never installed Python via it) on the other machine Homebrew has never been installed. I can reproduce the issue:
gives the error:
It seems from that testing that the issue is in 2020.6.2 and not limited/related only to Homebrew. Not sure if it is macOS specific. ======= Just to add... I first noticed this in PyCharm which got confused after I upgraded Pipenv (but only noticed when I started a new project) but I confirmed it via command line. |
Rolling back to the previous version fixes it for me:
|
As noted in #4316, this bug breaks To manually remove a pipenv virtualenv: pipenv_venv="$(PIPENV_IGNORE_VIRTUALENVS=1 pipenv --venv)" && rm -rf "${pipenv_venv}" |
I am observing the same problem. I have The following is what I have: ~/dummy> which python3
/usr/local/bin/python3
~/dummy> printenv PATH
/Users/eaytard/Library/Python/3.7/bin:/usr/local/opt/node@12/bin:/Users/eaytard/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
~/dummy> python3 -V
Python 3.7.7
~/dummy> python3 -m pip list | grep -i pipenv
pipenv 2020.6.2
~/dummy> python3 -m pipenv --python 3.7
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.
Creating a Pipfile for this project…
~/dummy> cat Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "2.7" Weird enough, even though I use $ python3 -m pipenv --supportPipenv version: Pipenv location: Python location: Python installations found:
PEP 508 Information:
System environment variables:
Pipenv–specific environment variables: Debug–specific environment variables:
Contents of [[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "2.7"
|
I have the exact same issue with both |
Regarding the versioning, I was also getting the |
Thank you for the heads-up. However, I still have the problem. Check below (using ~/dummy> pipenv install --python (which python) # or, python3 -m pipenv install --python (which python)
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.
Creating a Pipfile for this project…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (dfae9f)!
Installing dependencies from Pipfile.lock (dfae9f)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
~/dummy> cat Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "2.7" |
Yes, same problem. Just reinstalled Catalina, installed pipenv via Homebrew and on the very first test run was greeted with :
Although it did proceed and created virtual environment. |
Did a little of digging here and I was able to fix it by following these steps
Doing that did solve the issue when previously for some reason |
I did not uninstall the python, but only reinstall the pipenv via pip3. The problem is fixed. |
I removed pipenv from brew then reinstalled pipenv via pip3 and all is good now. |
I have recently removed ~> python3 -m pip list --user
Package Version
---------------- ---------
appdirs 1.4.4
certifi 2020.6.20
distlib 0.3.1
filelock 3.0.12
pip 20.1.1
pipenv 2020.6.2
six 1.15.0
virtualenv 20.0.26
virtualenv-clone 0.5.4 With this change, I do not have the problem anymore. |
This worked for me as well on macOS Catalina (v. 10.15.4). That's all good, but I'd really like to know why this solution seems to work. Can anybody provide some insight on this? |
This is a great interim solution, @willbowditch -- thank you. Based on the directory structure (read: enclosed within Homebrew's Cellar directory), this sidesteps having to pollute your system Python environment (i.e., |
Also confirmed |
Why was this closed? |
@ruslaniv Can you paste the command output together with At least I can't reproduce with the same version installed from homebrew |
[rsln-u7WGlhGX]ruslan@rsln:~/OneDrive/Home/Dev/projects/personal/rsln|f_blog
⇒ pipenv --venv
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.
/Users/ruslan/.local/share/virtualenvs/rsln-u7WGlhGX $ pipenv --supportPipenv version: Pipenv location: Python location: Python installations found:
PEP 508 Information:
System environment variables:
Pipenv–specific environment variables: Debug–specific environment variables:
|
The warning only show when $ /usr/local/Cellar/pipenv/2020.11.4/libexec/bin/python -c "from pipenv import environments;print(environments.is_in_virtualenv())" Did you set |
Just FYI, I was having this issue but a pipenv update (through homebrew) fixed it. Possibly what others are seeing now is a new issue. |
Fixed for me on 2020.11.4 as well. |
Have tried every solution aboved but still getting this error. I am using the latest version of pipenv: 2020.11.15 |
yo también lo tengo el mismo error. |
encontré una solución es haciendo todo el proceso sin salir de la primer consola, dejé de hacer el codigo en la terminal de vscode, en la misma ventana de cmd que instalé pipenv y cree el entorno virtual,ahí mismo estoy haciendo todo y no me sale esas advertencias y errores. |
|
Whenever 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..?
$ 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:
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'):Contents of
Pipfile.lock
('/Users/toni/test3/Pipfile.lock'):The text was updated successfully, but these errors were encountered: