I have trouble using anaconda environment in Tmux. I am on OSX.
I first
tmux
Then activate the Conda env:
conda activate myenv
At this point when I conda info
shows the correct active environment and correct location. But which python
still points to the default /usr/bin/python
.
In the .bash_profile
I have these lines added by anaconda when installed. So I guess I need to add something to let the terminal find the right python path?
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/jiajunyang/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/username/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/username/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/username/anaconda3/bin:$PATH"
fi
fi
Thank you for your suggestion.
Go to the start menu, right-click 'Anaconda Prompt' and go to file location. Open its properties & change the target to the location of your preferred environment.
Open up your terminal. Search for available versions - can search for what you want, but we'll look for “python” > conda search python which returns something like this: Fetching package metadata: . To change your python version, you can now just type: conda install python=3.5.
Below works for me on macOS 10.15 with zsh:
Add below line to your ~/.tmux.conf
file
set -g default-command "/bin/zsh"
If you're using a shell other than zsh
, I assume changing the path to the shell you're using will also work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With