nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
34 stars 19 forks source link

Python Path Issue when running simulation #1575

Closed cqllysto closed 12 months ago

cqllysto commented 12 months ago

Hello,

Thank you for taking the time to help me. I am trying to follow Trick's tutorial to get a working simulation on my computer. I compiled the cannon ball simulation, but when I try to run the python input file, I am met with this error:

./S_main_Linux_11.4_x86_64.exe: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory

when I run whereis python3, I get the following output:

python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /usr/share/man/man1/python3.1.gz

I'm not sure why the library issue is coming up, but if there's anything I need to add to my bash file to fix a path, please let me know. Thank you!

jmpenn commented 12 months ago

Are you running on Mac or Linux?

cqllysto commented 12 months ago

Linux, Ubuntu 22

jmpenn commented 12 months ago

If you run "python3" from the command line, what happens?

cqllysto commented 12 months ago

It tells me my python version, which is 3.10.12 and that I'm running GCC 11.4

cqllysto commented 12 months ago

It also opens up a python terminal

jmpenn commented 12 months ago

I'm guessing that adding: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: [where-ever-your-python3-is-installed]/lib to your environment might fix it.

Another approach that I've found to eliminate some of the Python head aches is to set up and use a python virtual environment. See: https://nasa.github.io/trick/howto_guides/How-To-Python-Virtual-Environment

My experience has been that the virtual environment sets my python environment correctly and it just works. I have to go now . Perhaps we can figure it out tomorrow.

cqllysto commented 12 months ago

Hmm okay, Ill try the virtual environment. Thank you so much for your valuable time!

cqllysto commented 12 months ago

So I wiped and reinstalled my linux system hoping that the default settings would fix themselves and I wouldn't have to bother anyone. But I ran into a different issue with trick-CP not being a command. I ran into this problem before, but I fixed it by recloning the trick folder. However this time, it did not fix that issue. I am running through the tutorial that's up on the trick.io page for the cannon and this is my output.

== Trick data_products make complete == make[1]: Leaving directory '/home/cqllysto/trick/trick_source/data_products' make[1]: Entering directory '/home/cqllysto/trick/trick_source/java' Building java application... make[1]: Leaving directory '/home/cqllysto/trick/trick_source/java'

Trick compilation complete: Tue Sep 19 09:13:18 PM CDT 2023 cqllysto@pop-os:~/trick$ cd .. cqllysto@pop-os:~$ cd trick_sims/SIM_cannon_analytic/ cqllysto@pop-os:~/trick_sims/SIM_cannon_analytic$ trick-CP trick-CP: command not found

Im not sure if I have to run anything with root privileges to fix this :/ Sorry to bother you!

jmpenn commented 12 months ago

Regarding trick-CP not being a command, it sounds like you've not added trick/bin to your PATH.

Suppose you've installed trick in your home directory as trick.git/

Add the following to your .bash_profile :

export TRICK_HOME="${HOME}/trick.git"
export PATH=${PATH}:${TRICK_HOME}/bin
cqllysto commented 12 months ago

YAY IT WORKED. Thank you so much! The original issue didn't pop up either after the clean install :)