Within a larger class I have a section of code for importing a python script and running it. The file (animate.py) is contained within the same directory as the executable.
void classname::show( void )
{
stringstream run_cmd;
run_cmd << "animate.run('" << name << "')";
Py_Initialize();
PyRun_SimpleString("import animate");
PyRun_SimpleString(run_cmd.str().c_str());
Py_Finalize();
}
The thing is, I'm working through two computers, when compiled on one of these, this works fine. On my personal laptop it fails to import the scipt with the error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named animate
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'animate' is not defined
They're both compiled through the exact same makefile, with the -lpython2.7 flag used. The file structure is also the same.
Is there some library I'm missing to do this?