


{"id":246049,"date":"2023-01-10T14:23:42","date_gmt":"2023-01-10T14:23:42","guid":{"rendered":"\/forum\/forums\/topic\/license-error-running-ls-dyna-with-a-python-script-on-linux\/"},"modified":"2023-01-12T07:30:09","modified_gmt":"2023-01-12T07:30:09","slug":"license-error-running-ls-dyna-with-a-python-script-on-linux","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/license-error-running-ls-dyna-with-a-python-script-on-linux\/","title":{"rendered":"License Error running LS-Dyna with a python script on Linux"},"content":{"rendered":"<p>Hello,<\/p>\n<p>when I try to start a simulation within a python script, I get an error termination caused by a license problem.<\/p>\n<p>However, I have no problems starting a simulation in the linux terminal with the comand:<\/p>\n<p>~\/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<\/p>\n<p>For simplicity, I created a bash file called &#8220;Start_sim&#8221; to execute this command. So I can start the simulation by only calling the bash file in the terminal with:<\/p>\n<p>bash \/home\/christoph\/LSDYNA\/Docs\/Start_sim<\/p>\n<p>Now, I am trying to start the Simulation within a Python script. The script is also calling the bash file with:<\/p>\n<div>\n<pre>import subprocess<br><br>command = [\"bash\", \"\/home\/christoph\/LSDYNA\/Docs\/Start_sim.sh\"]<br>subprocess.run(command)<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>So this script should do exactly the same as calling the bash file by hand. However, I get the following error:<\/p>\n<p>*** License problem ***<br \/>&nbsp;Local license:<\/p>\n<p>&nbsp;*** Error Environment variable LSTC_FILE not set!<\/p>\n<p>&nbsp;<br \/>&nbsp;*** Error 70022 (OTH+22)<\/p>\n<p>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.<\/p>\n<p>I have set the environment variables LSTC_LICENSE_SERVER and LSTC_LICENSE. I tried to create a file called LSTC_FILE containing&nbsp;<\/p>\n<h1><span style=\"font-size: 12pt\">#<\/span><span style=\"font-size: 12pt\">LICENSE_TYPE: network<\/span><br \/><span style=\"font-size: 12pt\">#LICENSE_SERVER: corresponding license server<\/span><\/h1>\n<p><span style=\"font-size: 12pt\">and saved it in usr\/local\/lstc. But the error still occured. I also created <\/span><span style=\"font-size: 12pt\">an environment variable called LSTC_FILE containing the path to the file &#8220;LSTC_FILE&#8221;. Still didn&#8217;t work.<\/span><\/p>\n<p><span style=\"font-size: 12pt\">I would be very happy, if anyone could help me or maybe had a similar problem.<\/span><\/p>\n<p><span style=\"font-size: 12pt\">Thanks \ud83d\ude42<\/span><\/p>\n<p><span style=\"font-size: 12pt\">Christoph<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"template":"","class_list":["post-246049","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["272310","200"],"_bbp_author_ip":["23.192.164.18"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["811"],"_edit_lock":["1673422927:202441"],"_bbp_status":["publish"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["246049"],"_bbp_forum_id":["27814"],"_bbp_engagement":["200","272310"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["246289"],"_bbp_last_active_id":["246289"],"_bbp_last_active_time":["2023-01-12 07:30:01"]},"test":"christoph-hollweckoth-regensburg-de"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/246049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/246049\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=246049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}