stcorp / harp

Data harmonization toolset for scientific earth observation data
http://stcorp.github.io/harp/doc/html/index.html
BSD 3-Clause "New" or "Revised" License
55 stars 18 forks source link

import harp failing - cannot load harp.dll #234

Closed monicaec closed 3 years ago

monicaec commented 3 years ago

Hi, I have installed HARP (tried both 1.10 and 1.11 versions) on Windows 10 using the binary, and then copied the python > harp directory into my Python 3.7 site-packages directory. I have a working Visual Studio Community 2019 installation. However, I am not able to import harp in Python.

When I try to import (using Jupyter notebooks) it this error pops up: image

And this output in the Jupyter notebook: image

Looking further into the error I tried substituting the 'clib' argument - = 'harp.dll' - in the function that gives the error (_ffi.dlopen in _harppy.py) by 'coda.dll' and printing the output of the function and although of course it gives an error after opening the file because this is not the DLL it should be opening, the _ffi.dlopen function does work and the result of printing it is: <Lib object for 'coda.dll'>

So I guessed it can't open the harp.dll. I tried to open it also with ctypes.WinDLL( ) and I got the same result.

Would anyone know how to solve this, please? Any help will be really appreciated!!

svniemeijer commented 3 years ago

The Python interface of HARP requires access to the harp.dll that is located in the bin directory of your HARP installation (including the other .dll files that are located there). So make sure that your HARP installation still exists.

In addition, the HARP installer automatically adds the bin directory of your HARP installation to your PATH system environment setting. Make sure that you do not override this. Or, otherwise, explicitly add this path to your PATH environment variable.

Note that for a jupyter environment I would highly recommend that you use anaconda/miniconda and install HARP using conda install -c stcorp harp.

svniemeijer commented 3 years ago

Closing issue, as there is no further update.