how to make escript be callable by python

Asked by Lou Jichao on 2019-03-14

My computer system is ubuntu16.04LTS. And i have installed escript successfully. But now I want to make escript be callable by python.If I want to use the "python example01a.py" in a teminal, what should I do

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Ellery
Solved:
2019-03-19
Last query:
2019-03-19
Last reply:
2019-03-18
Adam Ellery (aellery) said : #1

Hi Lou,

You may need to tell Python where to locate the escript library files by adding the escript library folder to LD_LIBRARY_PATH. You can do this by running the command

eval `run-escript -e`

in your console. (Note that you must use the back tick symbol, not an apostrophe.) If you add this command to your ~/.bashrc file then your console should run it automatically whenever you open a new console window.

Adam

Lou Jichao (ljc-1) said : #2

I have run the command, eval `run-escript -e`,but it didn't work.
bash: cd: /home/ljc/OpenFOAM/ljc-6/run: 没有那个文件或目录(There is no such file or directory )
My escript source directory is /home/ljc/escrpt/src

And I have try to add this command to my ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ljc/LIGGGHTS/LIGGGHTS-PUBLIC/src:/home/ljc/escript/src
but it didn't work either.

Best Adam Ellery (aellery) said : #3

Hi Lou,

I think you may have to add this command to your ~/.bashrc file:

export LD_LIBRARY_PATH=/home/ljc/escrpt/src/lib:$LD_LIBRARY_PATH

If that does not work, can you please run this command and tell me what the output is?

/home/ljc/escrpt/src/bin/run-escript -e

Lou Jichao (ljc-1) said : #4

Thanks Adam Ellery, that solved my question.