无法在PythonPython中使用netcdf4

2024-10-01 07:28:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法在PythonPython中使用netCDF4。当我执行“importnetcdf4”操作时,我得到以下错误:/home/myusrname/anaconda/lib//libk5密码.3:symbol k5_buf_free,版本krb5支持_0_MIT未在文件libkrb5中定义支持.so.0和链接时间引用。在

netCDF4模块一直工作得很好,直到我安装了pyart(天气雷达可视化软件),出于某种原因,它想重新安装netCDF4。另一个线程描述了这个问题(https://stackoverflow.com/questions/32050441/unable-to-use-netcdf4-within-python-anaconda),尽管解决方案是擦除并重新安装anaconda。有人知道另一个解决办法吗?谢谢!在


Tags: 版本free密码homelib错误anacondasymbol
1条回答
网友
1楼 · 发布于 2024-10-01 07:28:58

我也遇到了同样的问题,甚至完全卸载并重新安装Anaconda发行版也没有解决这个问题。看起来使用“conda”安装netCDF4现在在错误的地方查找krb库。在

在最近将netCDF4代码更新到版本1.1.7之后,我能够让它正常工作。这是他们网站(https://github.com/Unidata/netcdf4-python)的更新信息:

3/19/2015: Version 1.1.7 released. Global Interpreter Lock (GIL) now released >when extension module calls C library for read operations. This speeds up >concurrent reads when using threads. Users who wish to use netcdf4-python >inside threads should read http://www.hdfgroup.org/hdf5-quest.html#gconc >regarding thread-safety in the HDF5 C library. Fixes to setup.py now ensure >that pip install netCDF4 with export USE_NCCONFIG=0 will use environment >variables to find paths to libraries and include files, instead of relying >exclusively on the nc-config utility.

接下来,我设置环境变量“USE\unconfig=0”,然后使用“pip”来安装netCDF4,而不是“conda”。终于让它开始工作了。希望这对你也有用(或者你已经修好了…)。在

相关问题 更多 >