0

I am trying to use the Python API for TerrSet (formerly Idrisi) to run some tests. According to the downloadable API documentation (https://clarklabs.org/download/idrisi-applications-programming-interface-api-for-terrset/) you only need to have installed TerrSet on your system and run the following:

import win32com.client
IDRISI32 = win32com.client.Dispatch('IDRISI32.IdrisiAPIServer')
...

However, I get an error on the first line of code:

ImportError: No module named win32com.client

Looks like the module cannot be found.

Can anyone help me out on what is happening and how I can access the API in Python?

2

Yes, win32com.client comes with PyWin32. You can install with pip if you have it, via command line: pip install pypiwin32, or python -m pip install pypiwin32. If you don't have pip installed, you can download and install the client from this site.

Once that's running, Idrisi should open up in the foreground when you call it, as per your example. As your script hits calls to different modules, they'll run in that window/session of Idrisi. One note, some of the functions are a bit tricky with the API (the input parameters need blanks as ''), but through trial and error I've been able to get what I needed to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.