Python PDM Project
https://github.com/pdm-project/pdm
My Problem
In context below I want to activate the in-project virtual environment automatically whenever the directory changes to inclued the path ~/pydev/pdm-test.
Tree View of PDM Test Folder
$ tree ~/pydev/pdm-test -aL 2
/home/joe/pydev/pdm-test
├── 0000-proj0000
│ ├── main.py
│ └── __pycache__
├── 0005-proj0005
├── 0010-proj0010
├── pdm.lock
├── .pdm.toml
├── pyproject.toml
└── .venv
├── bin
├── .gitignore
├── lib
└── pyvenv.cfg
Manual Activation of Virtual Environment (this works)
$ eval $(pdm venv activate in-project)
Virtual Environment Autodetection
https://pdm.fming.dev/latest/usage/venv/
When no interpreter is stored in the project config or PDM_IGNORE_SAVED_PYTHON env var is set, PDM will try to detect possible virtualenvs to use:
- venv, env, .venv directories in the project root
- The currently activated virtualenv
Question - Where is the "project config" file and how do I edit this file or use a pdm command to enable virtual environment autodetection?
The python path is stored in the project config file
.pdm.toml, view it and remove the corresponding line to clear the python path. You can also do it with command line:pdm config -ld python.path