2.2 Install --Enter homebrew-cask. If you already have it, go to install miniconda.
terminal
$ brew cask
--Install miniconda
terminal
$ brew cask install miniconda
terminal
$ conda create python=3.6 -name test_environment
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /usr/local/Caskroom/miniconda/base/envs/test_environment
added / updated specs:
- python=3.6
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/osx-64::ca-certificates-2019.10.16-0
certifi pkgs/main/osx-64::certifi-2019.9.11-py36_0
libcxx pkgs/main/osx-64::libcxx-4.0.1-hcfea43d_1
libcxxabi pkgs/main/osx-64::libcxxabi-4.0.1-hcfea43d_1
libedit pkgs/main/osx-64::libedit-3.1.20181209-hb402a30_0
libffi pkgs/main/osx-64::libffi-3.2.1-h475c297_4
ncurses pkgs/main/osx-64::ncurses-6.1-h0a44026_1
openssl pkgs/main/osx-64::openssl-1.1.1d-h1de35cc_3
pip pkgs/main/osx-64::pip-19.3.1-py36_0
python pkgs/main/osx-64::python-3.6.9-h359304d_0
readline pkgs/main/osx-64::readline-7.0-h1de35cc_5
setuptools pkgs/main/osx-64::setuptools-42.0.1-py36_0
sqlite pkgs/main/osx-64::sqlite-3.30.1-ha441bb4_0
tk pkgs/main/osx-64::tk-8.6.8-ha441bb4_0
wheel pkgs/main/osx-64::wheel-0.33.6-py36_0
xz pkgs/main/osx-64::xz-5.2.4-h1de35cc_4
zlib pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate test_environment
#
# To deactivate an active environment, use
#
# $ conda deactivate
terminal
$ conda activate test_environmente
Depending on the version, it seems that it may be `source activate hogehoge```, but in
conda version: 4.7.12``` it seems to be ```
conda activate hogehoge```. Differences between versions have not been investigated.
This activation will not succeed the first time. Since it is said that "initialization is required in the shell you are using",
terminal
$ conda init zsh
Please put the shell you are using in ** zsh **. When you execute it, the following will be described in .zshrc etc.
~/.zshrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
. "/usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh"
else
export PATH="/usr/local/Caskroom/miniconda/base/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
After doing this, you should be able to use the rest, so reopen the terminal or reload the .zshrc.
termianl
$ source .zshrc
――To check the current environment and other environments
terminal
$ conda env list
# conda environments:
#
base * /usr/local/Caskroom/miniconda/base
dlmugenknock /usr/local/Caskroom/miniconda/base/envs/dlmugenknock
test_environment /usr/local/Caskroom/miniconda/base/envs/test_environment
--Move and confirm the move
terminal
$ conda activate test_environment
$ conda env list
# conda environments:
#
base /usr/local/Caskroom/miniconda/base
dlmugenknock /usr/local/Caskroom/miniconda/base/envs/dlmugenknock
test_environment * /usr/local/Caskroom/miniconda/base/envs/test_environment
――How to get out of the environment
terminal
$ conda deactivate
--The rest is OK if you do `` `pip install hogehoge``` on the modules required for each environment. ――When you change the environment, the environment name appears next to it as shown in the picture.
Deep learning ∞ I made this knock Note on how to use Conda Use Miniconda
Recommended Posts