Jupyter notebook cannot find the solution record of python kernel (kernel)

Source of article: jupyter notebook cannot find solution record of python kernel (kernel) – WhiteNight's Site

It seems that there are many reasons for this problem, here is just one possible solution.

Preliminary summary: After a lot of effort, I finally successfully installed jupyter notebook and was able to create python3 files, but I discovered a new problem: it could not find the kernel.

Later, I went to the Internet to find a lot of methods, but I couldn't solve it. Finally, I thought I'd better try it myself. At this time, after I entered the following code, I suddenly discovered the problem.

conda env list

(The following are my thoughts . They are nonsense and may not be correct, just take a look)

I found that there is only one base environment. At this time, I suddenly thought: does this base environment contain the python3 kernel? In other words, can this base environment find the python3 kernel by itself ?

According to what I downloaded, I also wrote some things that are " super troublesome to use: you have to configure the environment variables yourself, and you have to download the missing dependencies yourself + package them into specific folders ". I suddenly thought : Do you need to package the python kernel yourself in order to run it normally?

Once you have a general solution direction, let’s try it first and then decide whether it works or not.

Anaconda, start! Then check the environment. There are so many packages in the base environment that it is impossible to look at them one by one. Found a create in the lower right corner. Click create, and find that there is a python option in the package that can be checked. At this time, I felt: This direction is right and it can work.

After checking, click create, it will take a while. After creating it, don't forget to switch the environment (you can also use CMD+activate xxx (the name of your new environment) to switch, this will also be used when using bat to switch Anaconda's virtual environment ), then open jupyter notebook. Hey, I can run away, perfect solution.

Writer's note

Actually not perfect. This thing "varies from machine to machine". For example, the environment I created above is called "py". In the py environment, when I enter "pip install xxx" in CMD, I get an error and cannot install libraries like sklearn (used for machine learning). However, in jupyter notebook, I create a new python3 file and enter the same command and run it, and it works. Downloaded and installed normally. I have no clue about this bug and have no idea how to fix it, let alone fix it. But... although it's a bit troublesome to use, it works normally anyway, so it doesn't seem to be a problem if you don't solve it... right?

Guess you like

Origin blog.csdn.net/white_night_SZTU/article/details/132871632