2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

DebianにpyenvとMinicondaをインストールし、仮想環境を作る

Last updated at Posted at 2023-11-04

gitをインストールする

sudo apt-get install git -y

pyenvをインストールする

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

pyenvの環境変数を追加する

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc

minicondaをインストールする

pyenv install miniconda3-4.7.12
pyenv global miniconda3-4.7.12
conda init bash
source .bashrc

仮想環境を作る

conda create -n entry_env python=3.10

仮想環境を表示する

conda env list

仮想環境を有効化する

conda activate entry_env
conda environments:
#
base                  *  /home/foobar/.pyenv/versions/miniconda3-4.7.12
entry_env                /home/foobar/.pyenv/versions/miniconda3-4.7.12/envs/entry_env

仮想環境を無効化する

conda deactivate

仮想環境を削除する

conda remove -n entry_env -all

以上です。

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?