zed
zed copied to clipboard
The terminal does not consider python from the right conda environment
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
I create a conda environment:
conda env create -f environment.yml
Then activate it with conda activate my_env
If I run which python
in the Zed terminal, my base python path is printed
If I run which python
in my iTerm2 terminal, my right conda env python path is printed
Environment
Zed: v0.132.0 (Zed Preview) OS: macOS 14.2.1 Memory: 16 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue.
No response
What is working for me is to specify the full python path of my env : ~/miniconda3/envs/pytorch/bin/python3 test.py
@Spoutnik97 are you able to resolve this issue?
Yes ! @Qazalbash I seems that the conda script initialzed when the terminal opened, does not work with Zed terminal...
Open your .zshrc file, and replace the Conda line at the end by these one :
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/me/miniconda3/bin/conda' 'shell.zsh' 'hook')"
if [ $? -eq 0 ]; then
export PATH="/Users/me/miniconda3/bin:/Users/me/miniconda3/condabin:$PATH" # Replace path to conda or miniconda here for Zed terminal
eval "$__conda_setup"
else
if [ -f "/Users/me/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/me/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/me/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
thus your PATH will include the right python and conda path, and conda activate will work
echo $PATH
@Moshyfawn @JosephTLyons any idea about the cause of this bug ?