python - 自动sklearn安装错误

标签 python python-3.x machine-learning scikit-learn pip

我正在尝试使用 pip install auto-sklearn 安装 auto-sklearn,但它引发了错误:

Command "/usr/bin/python3.5 -u -c "
    import setuptools, tokenize;
    __file__='/tmp/pip-build-tl8y2tfg/psutil/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-7t8rbku0-record/install-record.txt 
    --single-version-externally-managed --compile" 
failed with error code 1 in /tmp/pip-build-tl8y2tfg/psutil/

在我的 /tmp/ 目录中没有以“pip-”开头的内容。

我按照 manual 中的所有步骤进行了操作, 但仍然有这个错误。

我还尝试使用来自 this question 的命令,但在这两种情况下都出现了相同的错误。

我的操作系统是 Ubuntu 16.04.2。

如何安装 auto-sklearn?

最佳答案

auto-sklearn 安装需要 python 3.5 或更高版本。此外,它还依赖于此处提到的包:https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt

根据错误,您似乎在安装 psutil 时遇到问题。

更好的方法是拥有 python 3.5+ 环境。然后使用 pip install auto-sklearn

  • 检查您使用的是哪个版本/路径 - which python, which pip
  • 安装 python 3.5 或更高版本,如果您还没有:steps to follow
  • 安装正确版本的python 后,设置python3.5 的虚拟环境。 Follow设置虚拟环境的代码:

python3 -m pip install --user virtualenv

source env/bin/activate

  • 最后调用pip install auto-sklearn

更新:

  • 如果您使用的是 anaconda,则以下命令将启动您的虚拟环境:

    conda update conda #更新你当前的conda版本

    conda create --name py35 python=3.5 #为 python 3.5 创建一个虚拟环境

    source activate py35 #激活环境

再次在此处发布您的查询,以防您不确定这些步骤。

关于python - 自动sklearn安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44660524/

相关文章:

python - 这两种遍历列表的方法是否存在时间复杂度差异?

python - 如何检查字符串是否包含两个括号之间的数字并返回位置?

python - 如何增加文本小部件中的字体大小?

python - 分离 __iter__ 和 __next__ 方法

machine-learning - 大型多类 NLP 分类的数据和样本量不平衡

python - 自定义 Matplotlib 绘图

python - 如何通过长时间运行的插槽保持 UI 响应

python - 在Python 3中导入日志模块时如何解决 "No module named ' cStringIO'"

scala - 将 groupByKey() 替换为 reduceByKey()

python - XGBoost 产生非二进制预测