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

Ubuntu中安装Jupyter Notebook的Cling内核遇OSError错误求助

Fixing OSError: [Errno 2] No such file or directory When Installing Cling on Ubuntu

Hey there! Let's work through this frustrating error you're hitting while setting up Cling. That OSError: [Errno 2] from subprocess almost always means the script is trying to run a command that doesn't exist on your system, or it can't locate a required file/directory. Here are the most likely fixes to try:

1. Install all core system build dependencies

Even though you ran --check-requirements, sometimes that check might miss basic Ubuntu packages needed for compiling software. Let's install the essential tools and libraries Cling relies on:

sudo apt update && sudo apt install build-essential git cmake libncurses5-dev libtinfo-dev

These packages include compilers, version control, and supporting libraries. After installing, re-run your original command to see if the error clears up.

2. Fix PATH conflicts with Anaconda

Since you're using Anaconda2 (Python 2.7), there's a chance the Anaconda environment is overriding your system's PATH, making subprocess unable to find standard system commands. Try temporarily prepending the system bin directory to your PATH before running the script:

PATH=/usr/bin:$PATH ./cpt.py --check-requirements && ./cpt.py --create-dev-env Debug --with-workdir=./cling-build/

This tells the script to look for system commands first before checking Anaconda's paths.

3. Manually create the working directory

The --with-workdir=./cling-build/ flag tells the script to use that directory, but if it doesn't exist yet, subprocess might fail when trying to write to it. Let's create it upfront:

mkdir -p ./cling-build

The -p flag ensures the directory is created even if parent directories are missing. Then re-run your original installation command.

Python 2.7 has been end-of-life for years, and many modern scripts (including Cling's cpt.py) have better support for Python 3. If you don't strictly need Python 2.7 for other projects, try using Python 3 instead:

# Install Python 3 and pip if you don't have them
sudo apt install python3 python3-pip
# Run the script with Python 3
python3 cpt.py --check-requirements && python3 cpt.py --create-dev-env Debug --with-workdir=./cling-build/

This avoids any outdated Python 2.7 compatibility issues that could be causing the subprocess error.

If none of these work, sharing the full output of the --check-requirements command might help spot missing dependencies we haven't covered!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 03:42:20