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
Annoying venv warning #13875
Comments
Is your IPython installed in the venv or do you use a global IPython? The latter will cause the warning to appear, and the solution is to disable it in your config. |
The stuff runs in a Docker container. There I have a global Python 3.10.8 and a venv created via I can try to provide a |
Maybe that's the problem. It might be that you start the global So either you start Do these solutions not work for you? I found the warning also very annoying, and that's why I added the config option to suppress it. |
Well the following screenshot tells (at least) me, that the IPython installed in the venv is being executed while I get the mentioned warning: Thanks for the pointer to the cfg option. That is a better solution than commenting the warning. Nevertheless I assume that the warning is not supposed to appear anyway when I run the |
Yes, it looks like you are running |
I am using pyenv and pyenv-virtualenv If I stop my debugger on this line: ipython/IPython/core/interactiveshell.py Line 871 in 5d64897
and print the variables, we get In [1]: p_venv
Out[1]: PosixPath('/Users/<username>/.pyenv/versions/3.10.6/envs/foo')
In [2]: paths
Out[2]:
[PosixPath('/Users/<username>/.pyenv/versions/foo/bin/python'),
PosixPath('/Users/<username>/.pyenv/versions/foo/bin/python3.10'),
PosixPath('/Users/<username>/.pyenv/versions/3.10.6/bin/python3.10')] So the issue seems to be that In [3]:os.path.realpath(p_venv / "bin/python3")
Out[3]: '/Users/<username>/.pyenv/versions/3.10.6/bin/python3.10'
In [4]:os.path.realpath(sys.executable)
Out[4]: '/Users/<username>/.pyenv/versions/3.10.6/bin/python3.10' |
Hi!
Using
ipython
8.7.0 I just identified that the block below always triggers the annoying warning when I runipython
within apyenv
venv.ipython/IPython/core/interactiveshell.py
Lines 886 to 890 in d38397b
The instance variable
warn_venv
occurs two times in the whole module (here both locations in the snippets cutout) and seems to be always true.ipython/IPython/core/interactiveshell.py
Lines 511 to 514 in d38397b
I see no point to always get that message although I clearly run the
ipython
executable in the currently active venv.Maybe my symlink setup causes that?
Here you see something in my
neovim
session.Top pane: the module where above code listings come from
Middle pane: vars in a debug session in
pdb
Bottom pane: my symlink of
$HOME/.pyenv
and the env varVIRTUAL_ENV
Maybe someone wants to look deeper into that scenario. For now it looks like a warning that should not appear in this case and I disable it.
I wish a Merry Christmas,
Jamil
The text was updated successfully, but these errors were encountered: