Photonics

Photonics

Topics related to Lumerical and more

How to use python API in Lumerical

TAGGED: 

    • Ariel Lee
      Subscriber

      Hi, I am using Lumerical installed on a computer cluster at a school and accessing Lumerical via a virtual desktop due to license related issue.

      In this type of setting, I am not sure how to use Python API, especially lumopt. When I try to run a Python script from the script editor, it shows an error message like this:

      "Python integration status: inactive

      Executable: Executable gnome-terminal or mate-terminal is required to launch a Python interpreter, but was not found in PATH."

      An article (https://optics.ansys.com/hc/en-us/articles/360050995394) says that I can directly run the examples by running the scripts from the script file editor in the CAD. However, I am not understanding what this means. Would you please give some advice on this problem?

       

      Thank you!

    • Priscila Romagnoli
      Ansys Employee

      Hi Ariel,

      Seems like your Python integration in Lumerical is inactive.

      Please check if you are using the Python provided by Lumerical. Go to “Help” tab and “Python Integration Configuration”. The “Use Python provided by Lumerical” option should be checked. In case it is not, please check if Python is added in the Path environment variables in Windows.

    • Priscila Romagnoli
      Ansys Employee

      Additionally, if you are using Python in Linux from the Lumerical CAD/GUI, it requires you to have a Gnome or Mate terminal, and you can run directly from the terminal (without CAD/GUI). Please check it if you have it installed.

      For more information to run Python API scrips please check: https://optics.ansys.com/hc/en-us/articles/5771091294739

    • Ariel Lee
      Subscriber

       

       

      Thank you for the reply. I am using Python in Linux, and my environment already has xfce4 terminal. Is it possible to use this terminal instead?

      Also, when I go to the “Help” tab and “Python Integration Configuration”, the Python integration status is inactive.

      The “Use Python provided by Lumerical” option is checked, but the path directory shown on the tab does not exist. The path shown on the tab is: “PYTHONPATH=/n/sw/lumerical-2021-R2-2717-7bf43e7149_seas/api/python:/n/sw/lumerical-2021-R2-2717-7bf43e7149_seas/python-3.6.8rc1/bin:/n/sw/lumerical-2021-R2-2717-7bf43e7149_seas/python-3.6.8rc1/lib/site-packages”

      but actually, the directory under “lib” folder is as shown below.

      How should I fix this to make the python integration status “active”?

      Thank you in advance!

       

       

    • Priscila Romagnoli
      Ansys Employee

      Hi Ariel,

      It is required to have a Gnome or Mate terminal for using Python with Lumerical in Linux, please install it.

      In addition, you can check the path in which Python and Lumerical are using, as described here: https://optics.ansys.com/hc/en-us/articles/5771091294739

      And if the path is not correct, please add it in the environment variables in Linux, as described here: https://optics.ansys.com/hc/en-us/articles/7595785040403

       

Viewing 4 reply threads
  • You must be logged in to reply to this topic.