Win10独立安装Spyder(Python3.6+,非Anaconda)及内核启动报错求助
Hey there, let's work through this kernel failure issue you're hitting with your standalone Spyder installation. The error you're seeing points to a missing or broken ipykernel component—this is the bridge between Spyder and your Python interpreter, so it's critical for running code in Spyder's console. Here's how to fix it step by step:
Step 1: Install/Upgrade ipykernel
First, make sure the ipykernel package is installed and up to date. Open Command Prompt (CMD) and run these commands:
- Install if missing:
pip install ipykernel - Upgrade if already installed:
pip install --upgrade ipykernel
Step 2: Register Your Python Environment with ipykernel
Next, register your Python 3.6+ environment so Spyder can recognize it as a valid kernel. Replace python36_env with a name you'll remember (like your Python version):
python -m ipykernel install --user --name=python36_env
Step 3: Configure Spyder to Use the Registered Kernel
- Open Spyder, go to Tools > Preferences (or press
Ctrl+Alt+S). - Navigate to Python interpreter in the left sidebar.
- Under Use the following interpreter, select the kernel you just registered (
python36_env). - Click Apply then OK, and restart Spyder.
Step 4: Verify Python Path (If Issues Persist)
Double-check that Spyder is pointing to your correct Python installation:
- In the same Python interpreter preferences, instead of selecting a kernel, choose Use the following interpreter and browse to
c:\python36\python.exe. - Restart Spyder again to apply this change.
Step 5: Reinstall Corrupted Packages (Last Resort)
If the above steps don't work, some packages might be corrupted. Force-reinstall Spyder and its core dependencies:
pip install --force-reinstall spyder ipykernel ipython
Why This Happens
The error traceback shows Spyder can't import ipykernel.kernelapp—this usually happens because ipykernel isn't installed (it's a dependency that sometimes gets missed in standalone Spyder installs) or there's a version mismatch between Spyder, ipykernel, and your Python version.
内容的提问来源于stack exchange,提问作者Saurabh Kansal

