如何查找和卸载numpy重复版本

问题描述 投票:2回答:2

我正在尝试安装库GPy。虽然安装成功,但我对我的numpy版本有疑问。

GPy库可以在这里找到https://github.com/SheffieldML/GPy

我的numpy的当前版本是1.9.3

>>> import numpy
>>> numpy.version.version
'1.9.3'

但是当我为GPy执行python setup.py install时,它指的是numpy 1.10.0。我检查了python 2.7 / site-packages,只有一个版本的numpy也存在1.9.3

Using /home/vinod/anaconda/lib/python2.7/site-packages
Searching for scipy==0.16.0
Best match: scipy 0.16.0
Adding scipy 0.16.0 to easy-install.pth file

Using /home/vinod/anaconda/lib/python2.7/site-packages
Searching for numpy==1.10.0
Best match: numpy 1.10.0
Adding numpy 1.10.0 to easy-install.pth file

Using /home/vinod/anaconda/lib/python2.7/site-packages
Finished processing dependencies for GPy==0.8.8
vinod@vinod-Lenovo-G580:~/GPy$ 

因为它指的是另一个版本,我得到的错误就像

File"__init__.pxd", line 155, in init GPy.util.linalg_cython (GPy/util/linalg_cython.c:4238)
ValueError: numpy.dtype has the wrong size, try recompiling

谁能告诉我如何找到并删除numpy 1.10.0?

python python-2.7 numpy
2个回答
0
投票

我尝试了以下步骤,但它仍然有效,但我仍然不知道如何。

  1. 我打开了setup.py并将numpy >= 1.7中的numpy条件更改为numpy <=1.9.3
  2. 然后我演奏了python setup.py install
  3. 然后我使用pip uninstall GPy卸载了GPy
  4. 我再次安装GPy但使用pip install GPy。注意:在之前的步骤中,我使用git并单独安装。
  5. 这次它在安装过程中将我的numpy升级到1.10.0并成功安装
  6. 最后现在它运作良好。

-1
投票

来自conda FAQ

conda update numpy --no-pin
© www.soinside.com 2019 - 2024. All rights reserved.