วิธีเพิ่ม Environment ใน Jupyter Notebook


Link : How to add your Conda environment to your jupyter notebook in just 4 steps

1. สร้าง conda environment

conda create --name=tf1 python=3.7

2. activate env ที่สร้าง

conda activate tf1

3. ติดตั้ง library เช่น

pip install tenforflow==1.15
pip install keras==2.3

4. ติดตั้ง jupyter notebook ใน env นั้น

conda install -c anaconda ipykernel

5. เปิด jupyter notebook ขึ้นมา

python -m ipykernel install --user --name=tf1

คำสั่งอื่นๆ ที่เกี่ยวข้อง
## Create the virtual environment
conda create -n 'environment_name' python=X.X

## Activate the virtual environment
conda activate 'environment_name'

## Make sure that ipykernel is installed
pip install --user ipykernel

## Add the new virtual environment to Jupyter
python -m ipykernel install --user --name='environment_name'

## To list existing Jupyter virtual environments
jupyter kernelspec list

## To list existing conda environments
conda env list

## To remove conda environment
conda env remove -n 'environment_name'

## To remove the environment from Jupyter
jupyter kernelspec uninstall 'environment_name'
Previous
Next Post »