导入错误:…/python2.7/site-packages/Scientific//u netcdf.so:未定义的符号:H5P\u CLS\u文件\u创建\u g
我在超级计算机中心分配的系统中安装了NetCDF,但当我运行python文件时,它显示: 导入错误:/public/home/geosign/opt/lib/python2.7/site-packages/Scientific//u netcdf.so:未定义的符号:H5P\u CLS\u文件\u创建\u g 进口恐怖主义:导入错误:…/python2.7/site-packages/Scientific//u netcdf.so:未定义的符号:H5P\u CLS\u文件\u创建\u g,python,hdf5,netcdf,scientific-computing,Python,Hdf5,Netcdf,Scientific Computing,我在超级计算机中心分配的系统中安装了NetCDF,但当我运行python文件时,它显示: 导入错误:/public/home/geosign/opt/lib/python2.7/site-packages/Scientific//u netcdf.so:未定义的符号:H5P\u CLS\u文件\u创建\u g 进口恐怖主义: Traceback (most recent call last): File "opt4.py", line 12, in <module>
Traceback (most recent call last):
File "opt4.py", line 12, in <module>
from ase.calculators.jacapo import Jacapo
File "/public/home/geosign/opt/lib/python2.7/site-packages/ase/calculators/jacapo/__init__.py", line 3, in <module>
from ase.calculators.jacapo.jacapo import *
File "/public/home/geosign/opt/lib/python2.7/site-packages/ase/calculators/jacapo/jacapo.py", line 21, in <module>
from Scientific.IO.NetCDF import NetCDFFile as netCDF
File "/public/home/geosign/opt/lib/python2.7/site-packages/Scientific/IO/NetCDF.py", line 168, in <module>
from Scientific._netcdf import *
ImportError: /public/home/geosign/opt/lib/python2.7/site-packages/Scientific/_netcdf.so: undefined symbol: H5P_CLS_FILE_CREATE_g
只有一件事值得怀疑。。。HDF5可能无法成功遵守,因为安装时会出现数百条类似警告(但是,由于我的专业不是CS,我无法完全理解)
我是如何配置hdf5的:
./configure --prefix=/public/home/geosign/usr --enable-hl --enable-shared --with-zlib=/public/home/geosign/usr --enable-threadsafe --with-pthread=/usr
我是如何配置netcdf的:
CPPFLAGS=-I/public/home/geosign/usr/include LDFLAGS=-L/public/home/geosign/usr/lib ./configure --prefix=/public/home/geosign/usr --enable-netcdf-4 --enable-shared
# NetCDF C Configuration Summary
==============================
# General
-------
NetCDF Version: 4.3.3.1
Configured On: Thu Oct 22 14:48:45 CST 2015
Host System: x86_64-unknown-linux-gnu
Build Directory: /public/home/geosign/software/netcdf-4.3.3.1
Install Prefix: /public/home/geosign/usr
# Compiling Options
-----------------
C Compiler: /usr/bin/gcc
CFLAGS: -g -O2
CPPFLAGS: -I/public/home/geosign/usr/include
LDFLAGS: -L/public/home/geosign/usr/lib
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library: yes
Static Library: yes
Extra libraries: -lhdf5_hl -lhdf5 -ldl -lm -lz
# Features
--------
NetCDF-2 API: yes
NetCDF-4 API: yes
HDF4 Support: no
HDF5 Support: yes
PNetCDF Support: no
Parallel Support: no
DAP Support: no
Diskless Support: yes
MMap Support: no
JNA Support: no
多谢各位!我已经做了好几天了……真伤心您是否已将
/public/home/geosign/usr/lib
添加到LD\u lirbaray\u路径
?如导出LD\u lirbaray\u路径=/public/home/geosign/usr/lib:$LD\u lirbaray\u路径是。我已经做到了。。。但它不起作用…我没有使用Scientific.\u netcdf,我建议您也应该使用python-netCDF4(Unidata托管包)。对于后者,我在“pip安装——允许所有外部”过程中声明了外部库,它可以工作。您是否将/public/home/geosign/usr/lib
添加到LD\u lirbaray\u PATH
?如导出LD\u lirbaray\u路径=/public/home/geosign/usr/lib:$LD\u lirbaray\u路径是。我已经做到了。。。但它不起作用…我没有使用Scientific.\u netcdf,我建议您也应该使用python-netCDF4(Unidata托管包)。对于后者,我在“pip安装——允许所有外部”期间声明了外部库,并且它可以工作。
./configure --prefix=/public/home/geosign/usr --enable-hl --enable-shared --with-zlib=/public/home/geosign/usr --enable-threadsafe --with-pthread=/usr
CPPFLAGS=-I/public/home/geosign/usr/include LDFLAGS=-L/public/home/geosign/usr/lib ./configure --prefix=/public/home/geosign/usr --enable-netcdf-4 --enable-shared
# NetCDF C Configuration Summary
==============================
# General
-------
NetCDF Version: 4.3.3.1
Configured On: Thu Oct 22 14:48:45 CST 2015
Host System: x86_64-unknown-linux-gnu
Build Directory: /public/home/geosign/software/netcdf-4.3.3.1
Install Prefix: /public/home/geosign/usr
# Compiling Options
-----------------
C Compiler: /usr/bin/gcc
CFLAGS: -g -O2
CPPFLAGS: -I/public/home/geosign/usr/include
LDFLAGS: -L/public/home/geosign/usr/lib
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library: yes
Static Library: yes
Extra libraries: -lhdf5_hl -lhdf5 -ldl -lm -lz
# Features
--------
NetCDF-2 API: yes
NetCDF-4 API: yes
HDF4 Support: no
HDF5 Support: yes
PNetCDF Support: no
Parallel Support: no
DAP Support: no
Diskless Support: yes
MMap Support: no
JNA Support: no