You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows10下Anaconda环境添加Jupyter Notebook R内核遇Error code 127

Fixing "jupyter-client has to be installed" Error When Adding R Kernel to Jupyter Notebook (Windows 10 + Anaconda)

Hey there, let's work through this R kernel installation issue together! That error about jupyter-client and exit code 127 is super common on Windows with Anaconda, and it almost always ties back to path mismatches or missing dependencies in your conda environment. Here's how to fix it step by step:

  • First, ensure your conda environment has jupyter-client installed
    Open up Anaconda Prompt, activate the environment you use for Jupyter (if you're using the base environment, just run conda activate base), then install jupyter-client directly via conda:

    conda install jupyter-client
    

    After installation, verify it works by running:

    jupyter kernelspec --version
    

    If this outputs a version number instead of an error, you're halfway there.

  • If R still can't find jupyter, specify the full path manually
    Sometimes R doesn't pick up the conda environment's jupyter executable automatically. Here's how to fix that:

    1. In Anaconda Prompt, run where jupyter to get the full path to your jupyter.exe file. It'll look something like C:\Users\YourUsername\anaconda3\Scripts\jupyter.exe.
    2. Launch R from the same Anaconda Prompt (just type R and hit enter—this ensures R uses the same environment variables as your conda setup).
    3. Run the installspec command with the full jupyter path (use either double backslashes or single forward slashes for the path):
      IRkernel::installspec(jupyter = "C:\\Users\\YourUsername\\anaconda3\\Scripts\\jupyter.exe")
      # Or use forward slashes:
      # IRkernel::installspec(jupyter = "C:/Users/YourUsername/anaconda3/Scripts/jupyter.exe")
      
  • For a more seamless setup, install R and IRkernel via conda
    If you installed R separately (not through Anaconda), you might run into more path conflicts. The easiest fix here is to install R and IRkernel directly in your conda environment:

    conda install -c r r-irkernel
    

    Once installed, launch R from Anaconda Prompt and run IRkernel::installspec()—this should work without any errors.

  • Final check
    Restart Jupyter Notebook and look for the R kernel option in the "New" dropdown. If it's still not showing up, try restarting your computer to refresh environment variables—sometimes that's all it takes!

内容的提问来源于stack exchange,提问作者Tim Hargreaves

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:06:47