Python加载旧版sklearn [英] Python loading old version of sklearn

查看:45
本文介绍了Python加载旧版sklearn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用

pip uninstall scikit-learn
pip install scikit-learn==0.18.2

但是,当我跑步时

python
>>> import sklearn
>>> sklearn.__version__

我明白了

'0.17'

有趣的是,即使我卸载了 scikit-learn,这个旧版本仍然被安装.这可能与以某种方式安装的多个版本的 Python 有关系吗?我曾一度试图使用 Anaconda 来尝试让 numpy 和 scipy 运行,但后来我转而使用 ActivePython.当我跑

Interestingly, this older version is still installed even after I uninstall scikit-learn. Could this have something to do with multiple versions of Python somehow being installed? I beat my head against the wall trying to use Anaconda at one point to try to get numpy and scipy running, and have since switched to ActivePython. When I run

which python

我明白

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

我知道在 SO 上有非常相似的问题,但发布的解决方案都没有奏效.

I know there are very similar questions on SO, but none of the posted solutions have worked.

推荐答案

检查您的 python 路径.在 unix 上:

Check your python path. On unix:

echo $PYTHONPATH

这将输出用于模块导入的所有路径.您可能在其他地方安装了一些旧版本.

This will output all paths used for module imports. You might have some old version installed elsewhere.

这篇关于Python加载旧版sklearn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆