Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2023-03-15 11:25:36

spod
Member
From: Gurgaon
Registered: 2023-02-13
Posts: 24

as_run not working anymore

Hello everyone,

Until recently, I was using Salome-Meca to prepare the input file and the .med mesh file. These files were then taken to /bin in the Code_Aster installation directory where they were run using as_run.
Code_Aster was installed in Linux that ran as a subsystem on a windows machine. This method was working until very recently when I installed OpenFOAM in Linux.

Now, when I try to run a study using as_run it shows the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ufi-pc8/Aster/lib/python3.8/site-packages/asrun/main.py", line 36, in <module>
    from asrun.run          import AsterRun
  File "/home/ufi-pc8/Aster/lib/python3.8/site-packages/asrun/run.py", line 801
    print(form % dinfo, file=ferr)
                            ^
SyntaxError: invalid syntax

I strongly believe this is due to installing OpenFOAM 1812, which runs on Python 2.7. Does anyone have suggestions on how I can fix this issue or if this really is the issue?

With Thanks and Regards
Yash


Attachments:
Screenshot 2023-03-15 155459.png, Size: 18.25 KiB, Downloads: 74

Offline

#2 2023-03-15 11:47:33

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: as_run not working anymore

hello

which command are you typing in the terminal?
please give the full path
with which code_aster version?

jean pierre aubry

Last edited by jeanpierreaubry (2023-03-15 11:48:02)


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#3 2023-03-16 11:46:39

spod
Member
From: Gurgaon
Registered: 2023-02-13
Posts: 24

Re: as_run not working anymore

jeanpierreaubry wrote:

hello

which command are you typing in the terminal?
please give the full path
with which code_aster version?

jean pierre aubry

I am using this command: as_run --quick --copy_all_results input.comm mesh.mmed
The path I am typing this command in is the installation directory of Code_Aster in which as_run is located
This is version 14.4

Thanking you
Yash

Offline

#4 2023-03-16 14:23:42

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: as_run not working anymore

i have never done it with these arguments
i all the time use a .export file as single argument
which allows me a finer control upon the results, type of files and directory
alos alows more file as input in a much simpler way

this said i do not know where your trouble may come from
may be a Python version as 14.4 is quite old and runs with Python 2.7 as far as i remember

Last edited by jeanpierreaubry (2023-03-16 14:27:14)


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#5 2023-03-21 10:03:58

spod
Member
From: Gurgaon
Registered: 2023-02-13
Posts: 24

Re: as_run not working anymore

jeanpierreaubry wrote:

may be a Python version as 14.4 is quite old and runs with Python 2.7 as far as i remember

I think so too, I have been trying a new installation. Let's see how it goes.
Thanks for your reply.

Offline

#6 2023-03-31 09:32:45

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 149

Re: as_run not working anymore

Can you try

 alias python=/usr/bin/ python3 

(remove space before python3)

before running as_run

Offline

#7 2023-04-03 10:28:24

spod
Member
From: Gurgaon
Registered: 2023-02-13
Posts: 24

Re: as_run not working anymore

hberro wrote:

Can you try

 alias python=/usr/bin/ python3 

(remove space before python3)

before running as_run

Hi, sorry about this but I completely uninstalled that installation and decided to get a fresh installation.
Thanks for your response!!

Offline