ElenorDavey
ElenorDavey

Reputation: 257

How to activate anaconda environment in bash script

I want to write a simple bash script that activates an anaconda environment and opens jupyter notebooks in that environment. I just want to simplify starting notebooks with a preferred environment.

This is what I have:

cd ~/my_notebooks_folder
conda activate my_env
jupyter-notebook
conda info

However, this still results in the base environment to be active and the notebooks are running using the base python.

I found two questions about this issue on StackOverflow. However, neither helped me. It seems that the functionality of conda been changed since those questions were posted?

I'm on Ubuntu and Linux Mint. conda version : 4.5.12.

These are the other questions/answers I tried:

Upvotes: 4

Views: 2667

Answers (1)

ElenorDavey
ElenorDavey

Reputation: 257

The suggestion by darthbith solved my problem; I need to install the Jupyter Notebook into my_env.

Upvotes: 1

Related Questions