@[TOC] When Anaconda changes the python compiler, it displays An error occurred while starting the kernel
reason
This is because the spyder_kernels package is not installed in your python compiler
Solution
1. Install the spyder_kernels package (please pay attention to ** here, it must be the spyder_kernels package (the command is pip install spyder_kernels), when anaconda reports an error, it sometimes prompts you to install spyder-kernels=0. This package, but I tried it, and after the installation is still Unable to connect *)
2. After installation, click Tools–preference–python interpreter in spyder to set the compiler to what you want to use (note that this can be the python compiler in the environment you created in anaconda, or It is a compiler you downloaded separately), for example, I want to use python3.8.5, which I have been using before.
3. After selecting and confirming, you need to click Consoles–Restart kernals, and the interface for entering the command line appears to indicate success.