Ubuntu18.04
$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
Next, add the path to .bashrc (in the case of profile, that is OK, but you should check the bash related relationships)
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
Apply changes by reloading .bashrc
$ sourec ~/.bashrc
Install anaconda using pyenv (any version you like)
$ pyenv install anaconda3-5.3.1
Move to the directory where you want to use the anaconda you just installed, and specify the distribution to be used in the directory with pyenv as anaconda.
$ cd ~/<YOUR_DIR_PATH>
$ pyenv local anaconda3-5.3.1
Build a virtual environment with the conda command
$ conda create -n <ENV_NAME>
Activate the created virtual environment
$ conda activate <ENV_NAME>
If you want to use the conda command or pip,
$ conda install pip
After doing
$ conda install <PACKAGE_NAME>
# or
$ pip install <PACKAGE_NAME>
Note that the package names are often different between conda and pip!
Recommended Posts