首页 > 解决方案 > NumPy 或 SciPy 的明显兼容性问题(预期来自 C 标头的 192,来自 PyObject 的 216)

问题描述

所以我从 conda-forge 安装了一些软件包(顺便说一下,我对此完全陌生),当我尝试运行一些脚本时,我得到了错误Expected 192 from C header, got 216 from PyObject。我已经尝试安装不同的 NumPy 版本,pip install 'numpy==some.version'但我一直收到同样的错误。我的猜测是,由于错误提示的内容,它与 SciPy 有关,但我真的迷路了,我宁愿问也不愿破坏某些东西。谢谢!

 RuntimeWarning                            Traceback (most recent call last)
~somescript.py in <module>
     12 
     13 import ephem
---> 14 import healpy as hp
     15 import matplotlib.pyplot as plt
     16 import numpy as np

~/python3.7/site-packages/healpy/__init__.py in <module>
     61 )
     62 
---> 63 from .sphtfunc import (
     64     anafast,
     65     map2alm,

~/python3.7/site-packages/healpy/sphtfunc.py in <module>
     25 import warnings
     26 import astropy.io.fits as pf
---> 27 from scipy.integrate import trapz
     28 from astropy.utils import data
     29 

~/python3.7/site-packages/scipy/integrate/__init__.py in <module>
     89 from __future__ import division, print_function, absolute_import
     90 
---> 91 from .quadrature import *
     92 from .odepack import *
     93 from .quadpack import *

~/python3.7/site-packages/scipy/integrate/quadrature.py in <module>
     11 # even though it's actually a numpy function.
     12 from numpy import trapz
---> 13 from scipy.special import roots_legendre
     14 from scipy.special import gammaln
     15 from scipy._lib.six import xrange

~/python3.7/site-packages/scipy/special/__init__.py in <module>
    632 from .sf_error import SpecialFunctionWarning, SpecialFunctionError
    633 
--> 634 from . import _ufuncs
    635 from ._ufuncs import *
    636 

__init__.pxd in init scipy.special._ufuncs()

RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject

标签: python-3.xnumpyscipycondaconda-forge

解决方案


推荐阅读