Lito Yap
Ansys Employee

@Amirali, 

Try to run the Python API from the CAD/GUI > Script editor window. Otherwise, see this Knowledge Base (KB) to configure your shell environment. 

How to run Lumerical API (Python) scripts in Linux – Ansys Optics 

Note that the KB shows the bash shell environment. Modify your's according to your linux distro and shell. Running scripts will always require a CAD/GUI connection and a GUI license. Ensure that you are connected to your Linux machine via GUI connection.

Lumerical product components and licensing overview – Ansys Optics 

Remote connection to Linux with a graphical interface – Ansys Optics