Using MarsConverter from outside -> No modules names MarsConverter
In order to fix this, 2 things to do.
1> In .bash profile
Make sure that the PYTHONPATH knows the MARSCONVERTER location
export MARSCONVERTER=~/MyDIR/marsconverter/
export PYTHONPATH="$MARSCONVERTER:$PYTHONPATH"
Of course, change MyDir
with your own location
2> In your Python code
import sys, os
# Part added to manage MarsConverter lib
try:
MARSCONVERTER = os.environ["MARSCONVERTER"]
except KeyError:
sys.exit("MARSCONVERTER env path is not defined. Please do it first.")
else:
sys.path.insert(0, MARSCONVERTER)
The following import should work better now.
from MarsConverter import MarsConverter