I had a problem trying to run Jupyter Notebook in Anaconda's virtual environment, so I will write down the remedy I took.
--Windows10 64bit Home version 20H2
There is a lot of information on the web, but I found this to be the easiest I've tried.
First, create a virtual environment.
$ conda create -n environment name python=Version library name
Enter the created virtual environment.
$conda activate environment name
Install Jupyter Notebook in a virtual environment. (Not required if you specified "jupyter" as the library name when creating the virtual environment and installed it together.)
$ conda install jupyter
Set the Jupyter Notebook kernel to display the created virtual environment.
$ ipython kernel install --user --name=Environment name
In this state, you can start Jupyter Notebook in the virtual environment with the following command.
$ jupyter notebook
But when I write Python code, it doesn't run. Jupyter tried to connect to the kernel many times and got an error. It seems that the DLL has failed to load because the following message appears.
File "C:\Users\User name\anaconda3\envs\Environment name\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error:The specified module cannot be found.
After searching around for a solution, I came up with the following information:
What to do when Anaconda's virtual environment is not recognized by jupyter or an error occurs
I will quote the command as it is, but I was able to solve it by executing this command in the virtual environment even in my own environment!
$conda uninstall pyzmq
$conda install pyzmq
$conda install jupyter
The method to remove the kernel of the virtual environment added to Jupyter is as follows.
$jupyter kernelspec uninstall environment name
Recommended Posts