If you install anaconda directly, it seems that it will collide with Homebrew, so I built anaconda environment with pyenv + conda.
Search for installable anaconda
pyenv install -l | grep anaconda
Installation
pyenv install anaconda3-2020.07
Switch anaconda to global
pyenv global anaconda3-2020.07
Creating a virtual environment
conda create -n [Virtual environment name] python=[python version] [Library you want to install] [Library you want to install] ...
Enable virtual environment created only in the working directory
mkdir test_conda
cd test_conda
pyenv local [Virtual environment name] #In the directory.python-A file called version is generated.
#When you exit the directory,Return to global-enabled environment
Start the created virtual environment with activate (specify the full path)
conda activate [Virtual environment name]
#You can also run the file directly in source
source $PYENV_ROOT/versions/anaconda3-2020.07/bin/activate [Virtual environment name]
Stopping the running virtual environment
conda deactivate
Library installation
conda install [Library name]
View installed libraries
conda list
Delete virtual environment
conda remove -n [Virtual environment name] --all
Recommended Posts