Python numpy库版本不符合要求

Posted 编号1993

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python numpy库版本不符合要求相关的知识,希望对你有一定的参考价值。

执行OpenFace的训练脚本,遇到如下问题:

/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/_libs/__init__.py:4: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/__init__.py:26: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import (hashtable as _hashtable,
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/dtypes/common.py:6: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import algos, lib
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/util/hashing.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import hashing, tslib
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/indexes/base.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import (lib, index as libindex, tslib as libts,
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/tseries/offsets.py:21: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
import pandas._libs.tslibs.offsets as liboffsets
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/ops.py:16: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import algos as libalgos, ops as libops
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/indexes/interval.py:32: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
...
...

网上找到解决方法:RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility

是因为库版本不兼容的原因,具体到当前问题,就是numpy库的最新版本不符合要求,需要使用之前的版本

当前numpy库版本号是1.15.0

(openface) zhujian@zhujian-virtual-machine:~/openface$ conda list numpy
# packages in environment at /home/zhujian/software/anaconda/anaconda3/envs/openface:
#
# Name                    Version                   Build  Channel
numpy                     1.15.0           py27h1b885b7_0  
numpy-base                1.15.0           py27h3dfced4_0  

将它修改为1.14.5

(openface) zhujian@zhujian-virtual-machine:~/openface$ conda install numpy=1.14.5
Solving environment: done

## Package Plan ##

environment location: /home/zhujian/software/anaconda/anaconda3/envs/openface

added / updated specs: 
    - numpy=1.14.5


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    numpy-1.14.5               |   py27h1b885b7_4          35 KB
    numpy-base-1.14.5          |   py27hdbf6ddf_4         4.1 MB
    ------------------------------------------------------------
                                        Total:         4.1 MB

The following packages will be DOWNGRADED:

    numpy:      1.15.0-py27h1b885b7_0 --> 1.14.5-py27h1b885b7_4
    numpy-base: 1.15.0-py27h3dfced4_0 --> 1.14.5-py27hdbf6ddf_4

Proceed ([y]/n)? y


Downloading and Extracting Packages
numpy-1.14.5         | 35 KB     | ################################################################################################################################################################# | 100% 
numpy-base-1.14.5    | 4.1 MB    | ################################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

参考文章提出用pip的方式

sudo pip uninstall numpy
sudo pip install numpy==1.14.5

修改后就不再有上述问题弹出

以上是关于Python numpy库版本不符合要求的主要内容,如果未能解决你的问题,请参考以下文章

错误记录Google Play 上架报错 ( 此版本不符合 Google Play 关于提供 64 位版本应用的要求。| 如果提供 x86 架构动态库则必须提供 x86_64 架构的动态库 )

pip/conda 安装库出现版本冲突问题

Python给照片换底色,基于opencv模块

python下numpy不成功,请问有没有简单的安装方法

pycharm中pip10.0报错,numpy等库安装失败

python3.6怎么安装numpy库