diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index a37cfc1..6571973 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -928,6 +928,11 @@ class InteractiveShell(SingletonConfigurable): elif len(str(p_venv)) >= 2 and str(p_venv)[1] == ":": p_venv = Path(str(p_venv)[2:]) + if sys.platform == "win32": + # On Windows there might be a mixture of lower-case and mixed-case paths + p_venv = Path(str(p_venv).lower()) + paths = [Path(str(p).lower()) for p in paths] + if any(os.fspath(p_venv) in os.fspath(p) for p in paths): # Our exe is inside or has access to the virtualenv, don't need to do anything. return