即使安装了新版本也使用旧版本的numpy [英] Using old version of numpy even with a newer version installed
本文介绍了即使安装了新版本也使用旧版本的numpy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用easy_install安装numpy来安装numpy 1.7.1,但是当我在python中检查版本时:
I have used easy_install to install numpy to install numpy 1.7.1, but when I check my version in python:
python -c "import numpy; print numpy.version.version"
它说1.6.2
我在做什么错了?
推荐答案
最有可能的是,您已从Debian存储库中安装了numpy或具有其他参数的pip安装.使用
Most likely, you have installed numpy from a debian repository or a pip installation with other parameters. Use
python -c 'import os,numpy;print(numpy.__file__)'
找出流氓numpy版本所在的位置.虽然您可以只删除该目录,但也可以询问软件包管理器该文件所属的软件包.同样,在debian系统上:
to find out where the rogue numpy version lies. While you can just delete this directory, you can also ask your package manager what package the file belongs to. Again, on a debian system:
$ python -c 'import numpy;print(numpy.__file__)'
/usr/lib/pymodules/python2.7/numpy/__init__.pyc
$ readlink -f /usr/lib/pymodules/python2.7/numpy/__init__.py
/usr/share/pyshared/numpy/__init__.py
$ dpkg -S /usr/share/pyshared/numpy/__init__.py
python-numpy: /usr/share/pyshared/numpy/__init__.py
$ sudo apt-get remove python-numpy
这篇关于即使安装了新版本也使用旧版本的numpy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文