Conda environments not showing up in Jupyter Notebook
Asked Answered
A

26

578

I installed Anaconda (with Python 2.7), and installed Tensorflow in an environment called tensorflow. I can import Tensorflow successfully in that environment.

The problem is that Jupyter Notebook does not recognize the new environment I just created. No matter I start Jupyter Notebook from the GUI Navigator or from the command line within the tensorflow env, there is only one kernel in the menu called Python [Root], and Tensorflow cannot be imported. Of course, I clicked on that option multiple times, saved file, re-opened, but these did not help.

Strangely, I can see the two environments when I open the Conda tab on the front page of Jupyter. But when I open the Files tab, and try to new a notebook, I still end up with only one kernel.

I looked at this question: Link Conda environment with Jupyter Notebook But there isn't such a directory as ~/Library/Jupyter/kernels on my computer! This Jupyter directory only has one sub-directory called runtime.

I am really confused. Are Conda environments supposed to become kernels automatically? (I followed https://ipython.readthedocs.io/en/stable/install/kernel_install.html to manually set up the kernels, but was told that ipykernel was not found.)

Addington answered 20/9, 2016 at 21:50 Comment(6)
conda install ipykernel seems to install jupyter in the environment... Am I missing something?Exuviate
presumably ipykernel has jupyter as a dependency?Manhood
no longer seems to work...see answer below from AndreasFrigg
@ThomasK this works only if nb_conda is used or if the kernel is setup manually as suggested in the question. Otherwise it will actually mess up things quite a lot. The executable jupyter will point to an executable inside the environment, but system's jupyter-notebook will be started (if installed) and therefore not use the environment with the default kernel.Tobolsk
I've written a comprehensive debugging guide in this Q&A: #58069318Tobolsk
see also #30493123Ysabel
A
880

I don't think the other answers are working any more, as conda stopped automatically setting environments up as jupyter kernels. You need to manually add kernels for each environment in the following way:

source activate myenv
pip install ipykernel
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

As documented here:http://ipython.readthedocs.io/en/stable/install/kernel_install.html#kernels-for-different-environments Also see this issue.

Addendum: You should be able to install the nb_conda_kernels package with conda install nb_conda_kernels to add all environments automatically, see https://github.com/Anaconda-Platform/nb_conda_kernels

Avivah answered 27/6, 2017 at 17:47 Comment(9)
Is is possible to somehow flag is at the most up to date solution as of today?Blaney
Installing nb_conda_kernels worked for me as of April 2018 (Python 3.6.4, conda 4.3.27, jupyter 4.4.0).Calces
Could one have different Jupyter configuration file per conda environment? Namely jupyter_notebook_config.py per environment.Emmons
If this isn't working for you try running conda install ipykernel this answer assumes that you already have that installed on your environment.Thun
This isn't working for me. If I load jupyter notebook in a certain environment, I still want to have my Jupyter notebook see all other conda environments that I have installed. So, inside Jupyter, conda kernelspec list does list my two environments. Their respective kernel.json points to two different python paths. However, if I do jupyter notebook inside a certain activated env, whatever kernel I am using, !which python always uses that python of the activated environment. Major limitation for me.Destruction
nb_conda_kernels not for python 3.9Caban
If it's not working, after trying this, restart the VS Code once ! It helped me!Terpsichorean
conda activate myenv worked for me instead of source activate myenvCorridor
it should be noted that this answer also works for people using pip instead of conda by simply running: pip install myenv source myenv/bin/activate python -m ipykernel install --user --name myenv --display-name "Python (myenv)"Cyprio
C
276

If your environments are not showing up, make sure you have installed

  • nb_conda_kernels in the environment with Jupyter
  • ipykernel and ipywidgets in the Python environment you want to access (note that ipywidgets is to enable some Juptyer functionality, not environment visibility, see related docs).

Anaconda's documentation states that

nb_conda_kernels should be installed in the environment from which you run Jupyter Notebook or JupyterLab. This might be your base conda environment, but it need not be. For instance, if the environment notebook_env contains the notebook package, then you would run

conda install -n notebook_env nb_conda_kernels

Any other environments you wish to access in your notebooks must have an appropriate kernel package installed. For instance, to access a Python environment, it must have the ipykernel package; e.g.

conda install -n python_env ipykernel

To utilize an R environment, it must have the r-irkernel package; e.g.

conda install -n r_env r-irkernel

For other languages, their corresponding kernels must be installed.

In addition to Python, by installing the appropriatel *kernel package, Jupyter can access kernels from a ton of other languages including R, Julia, Scala/Spark, JavaScript, bash, Octave, and even MATLAB.


Note that at the time originally posting this, there was a possible cause from nb_conda not yet supporting Python 3.6 environments.

If other solutions fail to get Jupyter to recognize other conda environments, you can always install and run jupyter from within a specific environment. You may not be able to see or switch to other environments from within Jupyter though.

$ conda create -n py36_test -y python=3.6 jupyter
$ source activate py36_test
(py36_test) $ which jupyter
/home/schowell/anaconda3/envs/py36_test/bin/jupyter
(py36_test) $ jupyter notebook

Notice that I am running Python 3.6.1 in this notebook: enter image description here

Note that if you do this with many environments, the added storage space from installing Jupyter into every environment may be undesirable (depending on your system).

Cymbre answered 4/4, 2017 at 2:26 Comment(14)
Hi Sorry to opening this thread again. However I tried everything as advised here and still dont see tensorflow env in jupyter. I have jupyter installed in the tensorflow env. I have python 3.6.1 installed there. I tried installing conda nb_conda but it says conflict with py3.6. So that didn't get installed rest everything else I have tried and doesn't seem to work. Any advice?Especially
ok. I checked again. My issue is that my jupyter when opened up with Python 3 kernel is not able to import any modules. I am not sure why is that. And also it doesn't show other env tooEspecially
@Especially I noticed that same error. I wanted to flesh out this answer but ran into that and didn't have time to solve it. I think this is a bug that should be reported as a git issue.Cymbre
Just found a git issue for the same. Apparently nb_conda doesn't work for py36 which means we cannot use py36 env in jupyter without nb_conda? Any hack anyone knows? github.com/ContinuumIO/anaconda-issues/issues/1423Especially
You can use it (I do all the time). You just have to start Jupyter from the environment you want to use in the notebook.Cymbre
i did that. It doesn't work because nb_conda doesn't work for python 3.6Especially
I just got it. It won't work with python 3.6 since nb_conda is not working for python 3.6. But one can create conda env with 3.5 and it works then. Can change environment then in jupyterEspecially
@Baktaawar, see my updated answer demonstrating how to use python 3.6 in the notebook. You can run a python 3.6 environment, you just have to start jupyter with that environment active. Conda environments can be thought of as self contained python installations. If you install Jupyter into your system python you would likewise only see one python kernel option. nb_conda's purpose is only to "[provide] Conda environment and package access extension from within Jupyter" not make it so you can run Jupyter from your chosen python installation.Cymbre
On 10/4/2018 this worked for me. I can now see my conda environments under the New dropdown selection list of jupyter web app.Glyceric
@merv, thanks for the tip about nb_conda_kernels. I just confirmed that works by installing miniconda, installing jupyter in the (base) environment, then creating a new environment. I was indeed able to see the environment I created.Cymbre
@StevenC.Howell thanks for addressing my concern. I think you still need to mention that ipykernel needs to be installed in each env you want to use as a kernel.Willson
@Willson In my testing, I actually do not have ipykernel in the environment I am accessing, only the environment where jupyter is actually installed. It must have been installed as a dependency since I did not actively install it. I am able to access the non-jupyter environment without it being installed. As as [possibly irrelevant] side note, I checked on installing ipykernel in the "non-jupyter" env and noticed that it will also install jupyter_client, jupyter_core, libsodium, pyzmq, and zeromq.Cymbre
@StevenC.Howell I'm just trying to advocate what is clearly stated in the documentation and I know from experience works consistently and minimizes bloating envs.Willson
Hmm, I'm not sure why it works without it. You're right, they clearly state it should be installed. I've added that to my answer. Thanks!Cymbre
D
125

The annoying thing is that in your tensorflow environment, you can run jupyter notebook without installing jupyter in that environment. Just run

(tensorflow) $ conda install jupyter

and the tensorflow environment should now be visible in Jupyter Notebooks started in any of your conda environments as something like Python [conda env:tensorflow].

Dallis answered 21/9, 2016 at 17:58 Comment(8)
I had the same problem as Thomas K, and the solution shared by Octavius solved my problem as well. However, there is one catch, if you have Python 3 version of Anaconda, then you would be able to see only your current active environment, and it should have it's own Jupyter. But if you install Python 2 version of Anaconda, it can handle all the environments.Emmalineemmalyn
you can do "conda install nb_conda" as well in Python2 version of anaconda to manage your envs from Jupyter itself.Emmalineemmalyn
@Emmalineemmalyn is correct. If your running Miniconda3 or Anaconda3, perform conda install nb_conda in one of your sourced conda environments (which has jupyter notebook installed). You can then switch kernels/conda envs in the jupyter notebook browser.Inflammatory
That's interesting as installing tensorflow either with the tensorflow websites instructions or using conda install tensorflow have both messed up conda on two different machines in two different ways. The first time I've had any problems with jupyter and conda was right after installing tensorflow.Emblazonment
Can report this method works on Sep 2018 with Anaconda 5.2 Python 3.6Spavin
This is a terrible answer because it encourages users to install Jupyter in every env, which is completely unnecessary. The reason why this works is that ipykernel (which is the only thing actually needed), is a dependency of jupyter.Willson
@merv: what's the best solution for this? is conda install nb_conda_kernels the best solution, then?Butz
@Butz I generally think that nb_conda_kernels is a clean, minimal solution. The only case I see use for installing Jupyter directly in an env is if one is actually developing a Jupyter extension and wants to include the version of Jupyter components as part of the project specs.Willson
D
117

I had to run all the commands mentioned in the top 3 answers to get this working:

conda install jupyter
conda install nb_conda
conda install ipykernel
python -m ipykernel install --user --name mykernel
Doubt answered 20/6, 2018 at 23:48 Comment(6)
This was what worked for me as well, but I didn't need conda install nb_condaThun
I just needed the first 3 commands to show the environment kernel as an option when I run jupyter lab inside that specific environmentVaccinia
Worked for me too. My god this was frustrating to figure out.Unskillful
You don’t need nb_conda! ;)Sacking
I tried every answer an this is the only one that worked. So, by the time I got to this answer, I had already executed the first three lines, that did not work, python -m ipykernel install --user --name mykernel is what did it.Kreitman
I had some troubles with the compatibility of ipython. To fix it, I had to upgraded ipython using this command pip install --upgrade ipython.Briones
W
64

Just run conda install ipykernel in your new environment, only then you will get a kernel with this env. This works even if you have different versions installed in each envs and it doesn't install jupyter notebook again. You can start youe notebook from any env you will be able to see newly added kernels.

Whisenhunt answered 25/4, 2017 at 18:1 Comment(2)
This is the best answer as of Jan 2018. Jupyter should auto-discover your kernel on startup if you simply conda install ipykernel inside your conda environment. Worst case, you can use python -m ipykernel install --user --name mykernel to manually generate the kernel, but you wouldn't want to do this if it's already auto-discovered, or it will show up twice in the kernel list.Piaffe
this will also install Jupiter and all it's dependencies. It works but somehow it's not optimalAilbert
A
29

Summary (tldr)

If you want the 'python3' kernel to always run the Python installation from the environment where it is launched, delete the User 'python3' kernel, which is taking precedence over whatever the current environment is with:

jupyter kernelspec remove python3

Full Solution

I am going to post an alternative and simpler solution for the following case:

  • You have created a conda environment
  • This environment has jupyter installed (which also installs ipykernel)
  • When you run the command jupyter notebook and create a new notebook by clicking 'python3' in the 'New' dropdown menu, that notebook executes python from the base environment and not from the current environment.
  • You would like it so that launching a new notebook with 'python3' within any environment executes the Python version from that environment and NOT the base

I am going to use the name 'test_env' for the environment for the rest of the solution. Also, note that 'python3' is the name of the kernel.

The currently top-voted answer does work, but there is an alternative. It says to do the following:

python -m ipykernel install --user --name test_env --display-name "Python (test_env)"

This will give you the option of using the test_env environment regardless of what environment you launch jupyter notebook from. But, launching a notebook with 'python3' will still use the Python installation from the base environment.

What likely is happening is that there is a user python3 kernel that exists. Run the command jupyter kernelspec list to list all of your environments. For instance, if you have a mac you will be returned the following (my user name is Ted).

python3       /Users/Ted/Library/Jupyter/kernels/python3

What Jupyter is doing here is searching through three different paths looking for kernels. It goes from User, to Env, to System. See this document for more details on the paths it searches for each operating system.

The two kernels above are both in the User path, meaning they will be available regardless of the environment that you launch a jupyter notebook from. This also means that if there is another 'python3' kernel at the environment level, then you will never be able to access it.

To me, it makes more sense that choosing the 'python3' kernel from the environment you launched the notebook from should execute Python from that environment.

You can check to see if you have another 'python3' environment by looking in the Env search path for your OS (see the link to the docs above). For me (on my mac), I issued the following command:

 ls /Users/Ted/anaconda3/envs/test_env/share/jupyter/kernels

And I indeed had a 'python3' kernel listed there.

Thanks to this GitHub issue comment (look at the first response), you can remove the User 'python3' environment with the following command:

jupyter kernelspec remove python3

Now when you run jupyter kernelspec list, assuming the test_env is still active, you will get the following:

python3       /Users/Ted/anaconda3/envs/test_env/share/jupyter/kernels/python3

Notice that this path is located within the test_env directory. If you create a new environment, install jupyter, activate it, and list the kernels, you will get another 'python3' kernel located in its environment path.

The User 'python3' kernel was taking precedence over any of the Env 'python3' kernels. By removing it, the active environment 'python3' kernel was exposed and able to be chosen every time. This eliminates the need to manually create kernels. It also makes more sense in terms of software development where one would want to isolate themselves into a single environment. Running a kernel that is different from the host environment doesn't seem natural.

It also seems that this User 'python3' is not installed for everyone by default, so not everyone is confronted by this issue.

Adai answered 4/3, 2019 at 14:58 Comment(1)
python -m ipykernel install --user --name test_env --display-name "Python (test_env)" works like a charm. Thank youAuriculate
D
26

To add a conda environment to Jupyter:

In Anaconda Prompt :

  1. run conda activate <env name>
  2. run conda install -c anaconda ipykernel
  3. run python -m ipykernel install --user --name=<env name>
Dryfoos answered 7/9, 2020 at 0:43 Comment(0)
M
20
    $ conda install nb_conda_kernels

(in the conda environment where you run jupyter notebook) will make all conda envs available automatically. For access to other environments, the respective kernels must be installed. Here's the ref.

Mediation answered 29/12, 2018 at 1:36 Comment(2)
Doesn't this just recapitulate https://mcmap.net/q/73178/-conda-environments-not-showing-up-in-jupyter-notebook?Willson
This looks like the simplest way.Paterfamilias
S
15

This worked for me in windows 10 and latest solution :

1) Go inside that conda environment ( activate your_env_name )

2) conda install -n your_env_name ipykernel

3) python -m ipykernel install --user --name build_central --display-name "your_env_name"

(NOTE : Include the quotes around "your_env_name", in step 3)

Snowinsummer answered 2/7, 2019 at 11:21 Comment(0)
F
14

The nb_conda_kernels package is the best way to use jupyter with conda. With minimal dependencies and configuration, it allows you to use other conda environments from a jupyter notebook running in a different environment. Quoting its documentation:

Installation

This package is designed to be managed solely using conda. It should be installed in the environment from which you run Jupyter Notebook or JupyterLab. This might be your base conda environment, but it need not be. For instance, if the environment notebook_env contains the notebook package, then you would run

conda install -n notebook_env nb_conda_kernels

Any other environments you wish to access in your notebooks must have an appropriate kernel package installed. For instance, to access a Python environment, it must have the ipykernel package; e.g.

conda install -n python_env ipykernel

To utilize an R environment, it must have the r-irkernel package; e.g.

conda install -n r_env r-irkernel

For other languages, their corresponding kernels must be installed.

Then all you need to do is start the jupyter notebook server:

conda activate notebook_env  # only needed if you are not using the base environment for the server
# conda install jupyter # in case you have not installed it already
jupyter

enter image description here


Despite the plethora of answers and @merv's efforts to improve them, it still hard to find a good one. I made this one CW, so please vote it to the top or improve it!

Falco answered 20/9, 2016 at 21:50 Comment(1)
Screenshot by Rich SignellFalco
S
12

This is an old thread, but running this in Anaconda prompt, in my environment of interest, worked for me:

ipython kernel install --name "myenvname" --user
Sialkot answered 27/3, 2021 at 3:38 Comment(2)
This did the trick for me. Previously, I was installing ipykernel this way: python -m ipykernel install --user --name=<environment-name>, but that method no longer seems to work, even though the environment appears as a kernel option.Interstitial
This worked perfectly. After trying the method on this post: https://mcmap.net/q/73178/-conda-environments-not-showing-up-in-jupyter-notebook. Still environment was not visible. However, your trick seems to make it work in the end even when working inside a jupyter lab workspace after refreshing the page.Largish
P
9

We have struggle a lot with this issue, and here's what works for us. If you use the conda-forge channel, it's important to make sure you are using updated packages from conda-forge, even in your Miniconda root environment.

So install Miniconda, and then do:

conda config --add channels conda-forge --force
conda update --all  -y
conda install nb_conda_kernels -y
conda env create -f custom_env.yml -q --force
jupyter notebook

and your custom environment will show up in Jupyter as an available kernel, as long as ipykernel was listed for installation in your custom_env.yml file, like this example:

name: bqplot
channels:
- conda-forge
- defaults
dependencies:
- python>=3.6
- bqplot
- ipykernel

Just to prove it working with a bunch of custom environments, here's a screen grab from Windows:

enter image description here

Pusan answered 19/1, 2018 at 20:49 Comment(0)
P
7

I ran into this same problem where my new conda environment, myenv, couldn't be selected as a kernel or a new notebook. And running jupter notebook from within the env gave the same result.

My solution, and what I learned about how Jupyter notebooks recognizes conda-envs and kernels:

Installing jupyter and ipython to myenv with conda:

conda install -n myenv ipython jupyter

After that, running jupter notebook outside any env listed myenv as a kernel along with my previous environments.

Python [conda env:old]
Python [conda env:myenv]

Running the notebook once I activated the environment:

source activate myenv
jupyter notebook

hides all my other environment-kernels and only shows my language kernels:

python 2
python 3
R
Poster answered 28/4, 2017 at 8:48 Comment(0)
T
6

This has been so frustrating, My problem was that within a newly constructed conda python36 environment, jupyter refused to load “seaborn” - even though seaborn was installed within that environment. It seemed to be able to import plenty of other files from the same environment — for example numpy and pandas but just not seaborn. I tried many of the fixes suggested here and on other threads without success. Until I realised that Jupyter was not running kernel python from within that environment but running the system python as kernel. Even though a decent looking kernel and kernel.json were already present in the environment. It was only after reading this part of the ipython documentation: https://ipython.readthedocs.io/en/latest/install/kernel_install.html#kernels-for-different-environments and using these commands:

source activate other-env
python -m ipykernel install --user --name other-env --display-name "Python (other-env)"

I was able to get everything going nicely. (I didn’t actually use the —user variable).

One thing I have not yet figured is how to set the default python to be the "Python (other-env)" one. At present an existing .ipynb file opened from the Home screen will use the system python. I have to use the Kernel menu “Change kernel” to select the environment python.

Trisoctahedron answered 14/11, 2018 at 23:59 Comment(0)
P
6

I had similar issue and I found a solution that is working for Mac, Windows and Linux. It takes few key ingredients that are in the answer above:

To be able to see conda env in Jupyter notebook, you need:

  • the following package in you base env:
    conda install nb_conda

  • the following package in each env you create:
    conda install ipykernel

  • check the configurationn of jupyter_notebook_config.py
    first check if you have a jupyter_notebook_config.py in one of the location given by jupyter --paths
    if it doesn't exist, create it by running jupyter notebook --generate-config
    add or be sure you have the following: c.NotebookApp.kernel_spec_manager_class='nb_conda_kernels.manager.CondaKernelSpecManager'

The env you can see in your terminal: enter image description here

On Jupyter Lab you can see the same env as above both the Notebook and Console: enter image description here

And you can choose your env when have a notebook open: enter image description here

The safe way is to create a specific env from which you will run your example of envjupyter lab command. Activate your env. Then add jupyter lab extension example jupyter lab extension. Then you can run jupyter lab

Phenosafranine answered 23/3, 2020 at 14:0 Comment(1)
Adding c.NotebookApp.kernel_spec_manager_class=.. to Jupyter configuration fixed my issue GCP's AI Platform. My guess is the nb_conda_kernels package was installed, but it was not configured to work with Jupyter.Kayak
F
4

While @coolscitist's answer worked for me, there is also a way that does not clutter your kernel environment with the complete jupyter package+deps. It is described in the ipython docs and is (I suspect) only necessary if you run the notebook server in a non-base environment.

conda activate name_of_your_kernel_env
conda install ipykernel
python -m ipykernel install --prefix=/home/your_username/.conda/envs/name_of_your_jupyter_server_env --name 'name_of_your_kernel_env'

You can check if it works using

conda activate name_of_your_jupyter_server_env 
jupyter kernelspec list
Falco answered 6/2, 2019 at 12:24 Comment(3)
actually, updating jupyter and using conda install nb_conda_kernels works better.Falco
Just note that python -m ipykernel install is the traditional route of registering an env, and works for other (non-Conda) envs. The idea behind nb_conda_kernels is that you don't need to do manually do this, as long as you install ipykernel.Willson
Yes! I turned this comment into this standalone answer.Falco
G
4

First you need to activate your environment .

pip install ipykernel

Next you can add your virtual environment to Jupyter by typing:

python -m ipykernel install --name = my_env
Giltedged answered 25/10, 2020 at 19:28 Comment(1)
After installing ipykernal, this worked: python -m ipykernel install --user --name myenv --display-name "Python (myenv)"Plaything
L
4

For conda 4.5.12, what works for me is (my virtual env is called nwt)

conda create --name nwt python=3

after that I need to activate the virtual environment and install the ipykernel

activate nwt
pip install ipykernel

then what works for me is:

python -m ipykernel install --user --name env_name --display-name "name of your choosing."

As an example, I am using 'nwt' as the display name for the virtual env. And after running the commands above. Run 'jupyter notebook" in Anaconda Prompt again. What I get is: new kernel

Lauzon answered 4/11, 2022 at 23:44 Comment(0)
P
3

Follow the instructions in the iPython documentation for adding different conda environments to the list of kernels to choose from in Jupyter Notebook. In summary, after installing ipykernel, you must activate each conda environment one by one in a terminal and run the command python -m ipykernel install --user --name myenv --display-name "Python (myenv)", where myenv is the environment (kernel) you want to add.

Parry answered 30/3, 2019 at 16:33 Comment(0)
V
2

Possible Channel-Specific Issue

I had this issue (again) and it turned out I installed from the conda-forge channel; removing it and reinstalling from anaconda channel instead fixed it for me.

Update: I again had the same problem with a new env, this time I did install nb_conda_kernels from anaconda channel, but my jupyter_client was from the conda-forge channel. Uninstalling nb_conda_kernels and reinstalling updated that to a higher-priority channel.

So make sure you've installed from the correct channels :)

Vardhamana answered 6/3, 2020 at 16:54 Comment(6)
Sounds like you may have the some things mixed up. jupyter and nb_conda_kernels should be installed in one env - this is where you always run jupyter notebook from. New envs only need ipykernel, but should not be activated when running jupyter notebook.Willson
I'm aware, it was on a new machine.Vardhamana
Okay. I edited your answer, mostly so I could change my vote, but also to clarify what you were calling the conda channel (not a thing - either defaults or anaconda). Feel free to edit it further if I'm misstating what happened.Willson
@merv: Is it possible to avoid installing a new ipykernel for each conda env?Kluge
@VimNing if you want to use it as a Python kernel in Jupyter, then no.Willson
@Willson Say I already installed JupyterLab into a standalone env, do I still need to install nb_conda_kernels for it nowadays?Kluge
C
2

I encountered this problem when using vscode server. In the conda environment named "base", I installed the 1.2.0 version of opennmt-py, but I want to run jupyter notebook in the conda environment "opennmt2", which contains code using opennmt-py 2.0. I solved the problem by reinstalling jupyter in conda(opennmt2).

conda install jupyter

After reinstalling, executing jupyter notebook in the opennmt2 environment will execute the newly installed jupyter

where jupyter 
/root/miniconda3/envs/opennmt2/bin/jupyter
/root/miniconda3/bin/jupyter
Ceilometer answered 21/2, 2021 at 6:41 Comment(0)
V
2

I just wanted to add to the previous answers: in case installing nb_conda_kernels, ipywidgets and ipekernel dosen't work, make sure your version of Jupyter is up to date. My envs suddenly stopped showing up after a period of everything working fine, and it resumed working after I simply updated jupyter through the anaconda navigator.

Vasomotor answered 13/8, 2022 at 18:3 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewReminiscent
Z
0

Using only environment variables:

python -m ipykernel install --user --name $(basename $VIRTUAL_ENV)
Zoellick answered 7/11, 2020 at 23:17 Comment(0)
B
0

Updated April 2023: You have to activate conda environment and then install the below dependecies

conda activate timm_tutorial
conda install jupyter
conda install nb_conda
conda install ipykernel
python -m ipykernel install --user --name mykernel

After this, click on the .ipynb file, if it gives Internal Error 500 then check to see your terminal log you got an error AttributeError: module 'charset_normalizer' has no attribute 'md__mypyc'

pip install chardet

I hope after that you can change the jupyter notebook kernel and run your script

Bigmouth answered 12/4, 2023 at 6:21 Comment(0)
J
0

My solution, I working with WSL, First: you need conda install nb_conda Second: conda deactivate Third: conda activate myenv Final: jupyter notebook If you want check env you choose, in homepage jupyter, choose tab conda, you can change another env

Juggernaut answered 13/9, 2023 at 3:41 Comment(0)
C
-1

In my case, using Windows 10 and conda 4.6.11, by running the commands

conda install nb_conda

conda install -c conda-forge nb_conda_kernels

from the terminal while having the environment active didn't do the job after I opened Jupyter from the same command line using conda jupyter notebook.

The solution was apparently to opened Jupyter from the Anaconda Navigator by going to my environment in Environments: Open Anaconda Navigator, select the environment in Environments, press on the "play" button on the chosen environment, and select 'open with Jupyter Notebook'.

Environments in Anaconda Navigator to run Jupyter from the selected environment

Convergent answered 27/5, 2019 at 14:30 Comment(1)
Have a look at the documentation on how to use Conda kernels. You launch Jupyter from the env that has Jupyter; you install ipykernel in all envs that you wish to use in Jupyter as kernels.Willson

© 2022 - 2024 — McMap. All rights reserved.