

If they are not and you have to install them simply pip install. Most of them are part of Anaconda bundle. Second, it requires NASA CDF library installed in you system (also 32 bit version). I assume, you work on Windows.Īccording to Spacepy documentation you need several dependencies to use its's cdf module.įirst of all it SpacePy officially supports only 32-bit python version, therefore you have to have python in 323bit. If for some reason definitions.B is not there, simply add the following: export CDF_BASE=$HOME/Libraries/cdf/cdf36_3-distĮxport LD_LIBRARY_PATH=$CDF_BASE/lib:$LD_LIBRARY_PATHĪssuming you installed spacepy with pip the following should work out of the box: from spacepy import pycdf The fix is easy, replace line 68 with the following: export LD_LIBRARY_PATH=$HOME/Libraries/cdf/cdf36_3-dist/lib:$LD_LIBRARY_PATH

The file above has a bug at line 68, instead of appending to environment variable LD_LIBRARY_PATH it overwrites it. $HOME/Libraries/cdf/cdf36_3-dist/bin/definitions.B bin called definitions.B that does this automatically for you, make it executable with chmod+x and add the following line to your ~/.bashrc ( Note: 1) I'm assuming you installed the library at the path $HOME/Libraries/ 2) There is a space after the. Installation should run smooth and add all the files in the. As a result this is the final make command: make OS=linux ENV=gnu CURSES=yes FORTRAN=no UCOPTIONS=-O2 SHARED=yes -j4 all I want to install the Curses-based toolkit programs that allow to use the command-line based interactive CDF tools (that's why we installed libncurses5-dev dependency in step 2). I am not interested in the FORTRAN interface, and my operating system supports shareable libraries. I will be building the distribution for Linux using the GNU C compiler. The two cents are that you want to check which compile variables are required/optional for your system and needs.

You should have downloaded a README.install file that contains a lot more details on this step than I'll provide. pip install numpy scipy h5py matplotlib networkxĪpt install build-essential gfortran libncurses5-dev You can install them all using conda or pip, and apt.

SpacePy and the CDF Library have several dependencies (as pointed out by Dyzma). if you want to download the code in a different path make sure you change the code below. Note: the following will create a directory in the current folder. Grab the source code using wget, and extract it. You can find the latest stable release at this link. Download the latest version of the CDF C Library: Here's an easy to follow guide if you didn't even know what the CDF file format was before you found this question on SO.ġ. The answer by is correct, but it assumes that you have already installed the CDF C Library.
