user7468395
user7468395

Reputation:

Python Jupyter Notebook: How to Change Python Executable for Unix Without Environments?

I have different Python environments on my Ubuntu machine:

What is the easiest way to let an ipython / jupyter notebook work with either the first or the second python environment (if possible it would be good if I do not need to create a virtual environment for that)?

Upvotes: 1

Views: 837

Answers (1)

uut
uut

Reputation: 1984

Looks like you already have two conda environments available on your machine. You could install the kernelspec for each one, and you should be able to use Jupyter with either.

# for /home/user/anaconda3/envs/my_env/bin/python
source activate my_env 
python -m ipykernel install --user --name my_env --display-name "Python (my_env)"
source deactivate

And now you should see Python (my_env) as an available kernel in Jupyter.

Upvotes: 1

Related Questions