karfly/learnable-triangulation-pytorch

Importing pycdf from spacepy correctly using Google Colab

robotAstray opened this issue · 1 comments

I am currently working on google colab and I would like to import pycdf from spacepy.
I have installed pycdf using pip install spacepy, following that I have set the CDF_LIB environmental variable to /usr/local/lib using the following.

os.environ["CDF_LIB"] = '/usr/local/lib'

However when using from spacepy import pycdf I get the following

Exception                                 Traceback (most recent call last)

[<ipython-input-95-81b0252608c2>](https://localhost:8080/#) in <module>
      2 import numpy as np
      3 import matplotlib.pyplot as plt
----> 4 from spacepy import pycdf

[/usr/local/lib/python3.7/dist-packages/spacepy/pycdf/__init__.py](https://localhost:8080/#) in <module>
   1301     raise Exception(('Cannot load CDF C library; checked {0}. '
   1302                      'Try \'os.environ["CDF_LIB"] = library_directory\' '
-> 1303                      'before import.').format(', '.join(_libpath)))
   1304 from . import const
   1305 lib = Library(_libpath, _library)

Exception: Cannot load CDF C library; checked . Try 'os.environ["CDF_LIB"] = library_directory' before import.

Am I doing something wrong? Thank you

OS, Python version, and dependency version information:

Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
sys.version_info(major=3, minor=7, micro=14, releaselevel='final', serial=0)
numpy=1.21.6
scipy=1.7.3
matplotlib=3.2.2

Version of SpacePy

I asked the question in the wrong repo. Apologies