-
-
January 10, 2023 at 2:23 pm
Christoph Hollweck
SubscriberHello,
when I try to start a simulation within a python script, I get an error termination caused by a license problem.
However, I have no problems starting a simulation in the linux terminal with the comand:
~/LSDYNA/Solver/ls-dyna_smp_s_R13_1_0_centos79_intel190/ls-dyna_smp_s_R13_1_0_x64_centos79_ifort190 i=/home/christoph/LSDYNA/LS_Dyna_k_Files/002_sphere_impact_FE/kugel.k ncpu=10 memory=20m
For simplicity, I created a bash file called "Start_sim" to execute this command. So I can start the simulation by only calling the bash file in the terminal with:
bash /home/christoph/LSDYNA/Docs/Start_sim
Now, I am trying to start the Simulation within a Python script. The script is also calling the bash file with:
import subprocess
command = ["bash", "/home/christoph/LSDYNA/Docs/Start_sim.sh"]
subprocess.run(command)Â
So this script should do exactly the same as calling the bash file by hand. However, I get the following error:
*** License problem ***
 Local license: *** Error Environment variable LSTC_FILE not set!
Â
 *** Error 70022 (OTH+22)Briefly said, If I call the bash file in the terminal by hand everything works fine, but when I use the python script, a license problem occurs.
I have set the environment variables LSTC_LICENSE_SERVER and LSTC_LICENSE. I tried to create a file called LSTC_FILE containingÂ
#LICENSE_TYPE: network
#LICENSE_SERVER: corresponding license serverand saved it in usr/local/lstc. But the error still occured. I also created an environment variable called LSTC_FILE containing the path to the file "LSTC_FILE". Still didn't work.
I would be very happy, if anyone could help me or maybe had a similar problem.
Thanks :)
Christoph
Â
Â
-
January 11, 2023 at 11:53 am
Christoph Hollweck
SubscriberI could find a solution by myself. When you work in a virtual environment (venv), it seems that the environment variables LSTC_LICENSE and LSTC_LICENSE_SERVER are not available in the venv, even though the variables should be defined globally. However, after defining them in the run/debug configurations, the script runs perfectly.
-
January 12, 2023 at 7:30 am
Aniket Chavan
Forum ModeratorThanks for being proactive and sharing the solution, this will help the others having similar issue!
-Aniket
-
- The topic ‘License Error running LS-Dyna with a python script on Linux’ is closed to new replies.
-
6520
-
1906
-
1463
-
1311
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.