jean-max rodriguez
jean-max rodriguez

Reputation: 1

"which python" shows ".pyenv/shims/python" in conda environment

I can't seem to solve this issue though it seemed like a trivial thing.

I'm on MacOs (Sequoia) and want to use a conda environment with python 3.8 in VSCode

conda create --name mmdettest python=3.8 -y
conda activate mmdettest 

Trivial right ? Now each time i use python show I get /Users/jean-max/.pyenv/shims/python

I tried a lot of different ways to solve the problem and nothing worked. Help would be really appreciated !

I tried this export PATH="/Users/jean-max/anaconda3/envs/mmdettest/bin:$PATH" but it showed python 3.11.11 which is weird.

I tried modifying the order of source ~/.zshrc but in fact .pyenv doesn't appear in it, only conda.

% echo $PATH
/Users/jean-max/anaconda3/envs/mmdettest/bin:/Users/jean-max/anaconda3/envs/mmdettest/bin:/Users/jean-max/.pyenv/shims:/Users/jean-max/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Users/j[...]

The path looks good to me, I really don't find the issue.

Upvotes: 0

Views: 29

Answers (1)

Qian
Qian

Reputation: 612

Run hash -r to reset your shell's cached paths after conda activate as there could be dynamic conflicts between Python conda and shims.

Upvotes: 0

Related Questions