Replies: 1 comment 5 replies
-
Somewhat related to #831. PDM_PYTHON=/path/to/python pdm run command |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to set a default Python version to use, but make it overridable via
.pdm.toml
. Any ideas how to achieve that?What I've tried so far:
export PDM_PYTHON=/path/to/python
This does indeed set a default Python that PDM then uses, but it's not overridable via
.pdm.toml
. Trying to set a different version withpdm use
printsWARNING: the config is shadowed by env var 'PDM_PYTHON', the value set won't take effect.
.pdm config python.path /path/to/python
This creates a
~/.pdm/config.toml
with the correct Python, but PDM ignores it in projects. Instead, if a local.pdm.toml
doesn't exist in the project, PDM creates it as soon as you run a command which needs the config (e.g.pdm info
) and setspython.path
to the first Python suggested bypdm use
(which is not necessarily the one I'd like to be the default, i.e. the one I set in~/.pdm/config.toml
). Not sure if this behavior is a bug or a feature?In any case, any help appreciated!
Beta Was this translation helpful? Give feedback.
All reactions