IPython-8 warns about virtualenv created by pyenv
See original GitHub issueHi, is there a way to disable the virtualenv warning?
I use pyenv, and every time IPython-8.0 starts from a virtual environment that’s based on pyenv’s miniconda, it shows this warning:
# Activate virtualenv via 'pyenv activate my_project_env' or 'pyenv activate my_base_python_env/envs/my_project_env'.
...
# Then, start ipython (installed in that virtual env).
$ ipython
/Users/xxx/.pyenv/versions/rubix-mds/lib/python3.9/site-packages/IPython/core/interactiveshell.py:802: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
warn(
Python 3.9.7 (default, Sep 16 2021, 08:50:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.0.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import sys
...:
...: sys.executable
Out[1]: '/Users/xxx/.pyenv/versions/rubix-mds/bin/python'
In [2]: import os
...:
...: os.environ["VIRTUAL_ENV"]
Out[2]: '/Users/xxx/.pyenv/versions/miniconda3-latest/envs/rubix-mds'
This only happens for virtualenv based on another pyenv’s miniconda3-latest. No warning shown with virtualenv based on another pyenv’s “python version”.
$HOME
`-- versions
|-- miniconda3-latest
| `-- envs
| `-- rubix-mds
`-- rubix-mds -> $HOME/.pyenv/versions/miniconda3-latest/envs/rubix-mds
I’d like to know if there’s a way to silent this particular warning?
Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
IPython startup script has permanently changed Jupyter ...
Upon completing the guide everything worked fine and whenever I created a new virtual environment using pyenv it used the jupyter3 virtual ...
Read more >Python Environment 101 - Towards Data Science
pyenv -virtualenv is a pyenv plugin that manages Python virtual environments ... virtualenv is a tool to create isolated Python environments.
Read more >pyenv, virtualenv and using them with Jupyter | Albert Au Yeung
This article aims at giving a quick introduction to pyenv and pyenv-virtualenv, as well as describing how one can easily create new kernels...
Read more >Managing Python virtual environments on Mac using pyenv ...
Step 1. Setup pyenv-virtualenv · Step 2. Download python versions · Step 3: Setup virtualenvwrapper · Step 4. Usage of pyenv virtualenvs and ......
Read more >Pyenv-virtualenv Multi Version - 3os
In order to use pyenv, pyenv-virtualenv without conflicting with the native macOS python we need to add some configuration to our ~/.zshrc ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hum, I would have to try, but see if you can use
warnings.filterwarnings
in one of the startup files.I’f not we can add a flag/config option to silence it.
Of course, the default is still to issue the warning. But people can silence it if they want.