[PYTHON] How to keep conda off

I want to keep conda off

This is a method to turn off the conda command and enable it with the conda command. It is a condition that anaconda is installed.

.bashrc, .zshrc settings

In .bashrc, .zshrc

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/user/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/user/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/user/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/user/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

There should be something like. It

function conda(){
    unset -f conda

When

}

Let's surround it with.

Example

function conda(){
    unset -f conda
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/user/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/user/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/user/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/user/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<
}

Commentary

I defined a conda function so that I can start conda. Type conda to call this function. After calling, unset this function with unset -f conda.

Finally

I wrote it during class, so please forgive me though it is a rough article.

Recommended Posts

How to keep conda off
How to create a Conda package
How to power off Linux with Ultra96-V2
How to keep track of work in Powershell
How to speed up scikit-learn like conda Numpy
How to use xml.etree.ElementTree
How to use virtualenv
Scraping 2 How to scrape
How to use Seaboan
How to use image-match
How to use shogun
How to install Python
How to use Pandas 2
How to read PyPI
How to install pip
How to use Virtualenv
How to use numpy.vectorize
How to update easy_install
How to install archlinux
How to use pytest_report_header
How to restart gunicorn
How to install python
How to virtual host
How to debug selenium
How to use partial
How to read JSON
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to update Spyder
How to use IPython
How to install BayesOpt
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015
How to use venv
How to use dictionary {}
How to use Pyenv
How to grow dotfiles
How to use list []
How to use python-kabusapi
"How to count Fukashigi"
How to install Nbextensions
How to use OptParse
How to install Prover9
How to use dotenv
How to operate NumPy
How to use pyenv-virtualenv
How to use imutils
How to use import
[2020.8 latest] How to install Python
How to estimate kernel density
[IPython] How to Share IPython Notebook
How to install Python [Windows]
How to use search sorted
[gensim] How to use Doc2Vec
Understand how to use django-filter
XPath Basics (2) -How to write XPath
How to use the generator