-
On my local machine the default interpreter is python3.11 however I want to debug a problem in python3.10. I use pyenv to install different python versions and control which one I'm using so I switch to python3.10 however my hatch environment still continues to use python3.11 ➜ pyenv shell 3.10
➜ hatch env prune
➜ python --version
Python 3.10.10
➜ hatch run python --version
Python 3.11.2
➜ ls -l "$(hatch run which python)"
Checking dependencies
Permissions Size User Date Modified Name
lrwxr-xr-x 53 jamiethomson 23 May 21:24 /Users/jamiethomson/Library/Application Support/hatch/env/virtual/jstark/SAIWlj1N/jstark/bin/python -> /Users/jamiethomson/.pyenv/versions/3.11.2/bin/python As can be seen the interpreter that hatch is using is python 3.11. How does hatch determine which interpreter to use and is there any way to force it to use an interpreter of my choice? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Answering my own question... use ➜ export HATCH_PYTHON=~/.pyenv/versions/3.10.10/bin/python
➜ hatch run python --version
Python 3.10.10 |
Beta Was this translation helpful? Give feedback.
-
FYI in the documentation I'm going to begin discouraging the use of pyenv now that we have these features: |
Beta Was this translation helpful? Give feedback.
Answering my own question... use
HATCH_PYTHON
to specify the python interpreter for the hatch environment