nasa/Kamodo

Errors calling kamodo from C++

Closed this issue · 2 comments

In order to call kamodo from C++, I had to remove the (C) from kamodo.py and change .util to util to prevent errors. Pybind11/C++ doesn't follow implied directory structure, so I had to use

from KamodoMaster.kamodo.kamodo import Kamodo, kamodofy

instead of the current import statement, and change all import statements with .util in the line to be util (without the .). Also, the last two lines of the __init__.py file caused errors for similar reasons. Changing these to the following worked:

from kamodo import *
from util import *

Regarding your issue importing kamodo, it sounds like you haven't installed Kamodo, but are instead loading it from the repo directory. Let's say you've cloned the Kamodo master repo into a local directory /path/to/Kamodo-Master. In that case, you would install like this

pip install -e /path/to/Kamodo-Master

This adds kamodo to the current python install, similar to other python libraries. The -e means that any changes to your code will be reflected in your version of kamodo next time you input.

Taking the steps above, your import would like like this:

from kamodo import Kamodo, kamodofy