如何解决在 Linux 中安装 scikit-learn 时的错误

如何解决在 Linux 中安装 scikit-learn 时的错误

当我尝试使用以下命令在 Linux Jetson 上安装 sckit-learn 时出现错误:

pip3 install scikit-learn

错误信息显示:

"/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-_6p4l1qb/numpy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-ttk4rc2k-record/install-record.txt
--single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-_6p4l1qb/numpy/

有人知道我为什么会收到这个错误以及如何修复它吗?

答案1

scikit-learn软件打包在 APT 中,因此你可以使用

sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python3-sklearn

然后继续入门

相关内容