Commit 228f881 1 parent cf58ae3 commit 228f881 Copy full SHA for 228f881
File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11
11
from pdm .models .python import PythonInfo
12
12
from pdm .models .venv import get_venv_python
13
13
from pdm .project import Project
14
+ from pdm .utils import is_conda_base_python
14
15
15
16
16
17
class Command (BaseCommand ):
@@ -123,7 +124,10 @@ def do_use(
123
124
if python :
124
125
use_cache : JSONFileCache [str , str ] = JSONFileCache (project .cache_dir / "use_cache.json" )
125
126
use_cache .set (python , selected_python .path .as_posix ())
126
- if selected_python .get_venv () is None and project .config ["python.use_venv" ]:
127
+
128
+ if project .config ["python.use_venv" ] and (
129
+ selected_python .get_venv () is None or is_conda_base_python (selected_python .path )
130
+ ):
127
131
venv_path = project ._create_virtualenv (str (selected_python .path ))
128
132
selected_python = PythonInfo .from_path (get_venv_python (venv_path ))
129
133
if not save :
You can’t perform that action at this time.
0 commit comments