How to choose your conda environment in Jupyter Notebook

2024/10/14 18:18:34

I installed Anaconda 5.3 with Python 3.7 (root environment).
After that I created a new environment (py36) using Python 3.6

I activated the new environment with activate py36
conda env list shows that the environement is active.

But when I start Jupyter Notebook (from the Anaconda prompt with jupyter notebook), it seems to use the root environemt, not the activated environment.

How can I use Jupyter Notebook with the new create environment (py36)?

Answer

As @Ista mentioned, the documentation gives an easy solution using notebook extensions.

conda install nb_conda

After installing, you have the option in Jupyter Notebook to 'Change kernel' from the 'Kernel' menu in your Jupyter Notebook.

https://en.xdnf.cn/q/69383.html

Related Q&A

How do I stagger or offset x-axis labels in Matplotlib?

I was wondering if there is an easy way to offset x-axis labels in a way similar to the attached image.

graphviz segmentation fault

Im building a graph with many nodes, around 3000. I wrote a simple python program to do the trick with graphviz, but it gives me segmentation fault and I dont know why, if the graph is too big or if im…

how to pass char pointer as argument in ctypes python

Please help me in converting below line of c++ code into ctypes python:Ret = openFcn(&Handle, "C:\\Config.xml");below are the declarations of each:typedef uint16_t (* OpenDLLFcnP)(void **…

Restarting a Python Interpreter Quietly

I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What…

Unique lists from a list

Given a list I need to return a list of lists of unique items. Im looking to see if there is a more Pythonic way than what I came up with:def unique_lists(l):m = {}for x in l:m[x] = (m[x] if m.get(x) !…

How to run Spyder with Python 3.7 with Anaconda

I have installed Anaconda on a Windows 10 machine which comes with Spyder and Python 3.6 but I wish to upgrade to Python 3.7To create an Anaconda Environment with Python 3.7 is easy by using:conda crea…

Pass in a list of possible routes to Flask?

Im learning Flask and have a question about dynamic routing: is it possible to pass in a list of accepted routes? I noticed the any converter which has potential but had a hard time finding examples o…

Tornado @run_on_executor is blocking

I would like to ask how tornado.concurrent.run_on_executor (later just run_on_executor) works, because I probably do not understand how to run synchronous task to not block the main IOLoop.All the exa…

Using Pandas read_csv() on an open file twice

As I was experimenting with pandas, I noticed some odd behavior of pandas.read_csv and was wondering if someone with more experience could explain what might be causing it.To start, here is my basic cl…

Disable Jedi linting for Python in Visual Studio Code

I have set my linter for Python to Pylint, but I still get error messages from Jedi. I even went to settings.json and added the line "python.linting.jediEnabled": false, but the line, though …