Python intregration error


I am unable to run FDTD solver using Python script.
I used attached script to run the FDTD solver, it POP-up the solver window, but with an error. I checked the path of the API, it seems to be fine. Can someone help?
PS : Don’t suggest me to upgrade software, as I am already using updated version of FDTD (FDTD Solutions 2018b R1 (v8.20.1634) for Windows (64 bit)). I upgraded this version last week itself. My OS is Window 10. (5.1 KB)



The error indicates you do not have the Automation API license for the Python Integration feature.

Please refer to this KB guide for more information on Python Integration:

You can obtain a trial license for the Automation API from our trials downloads page:
-using the Custom Evalution button.




There is no information on given link that I need to install the new license for Python integration with Lumerical. According to link, the API is already available in a specific folder (Windows: C:\Program Files\Lumerical$(PRODUCT)\api\python) and we need to just point that folder while importing this. The commands for importing this is following.

import imp
lumapi = imp.load_source("lumapi", "/opt/lumerical/interconnect/api/python/")

If I understood properly from this link, it does not require any additional license.

Anyway, I visit to the link,
and try to get the details. It seems like it will give me a trial license. So, I got a trial license from here. Now, I don’t understand what to do with this.
My system already has one license key, so if I try to enter this new key, it is basically asking me to deactivated previous license. This means this trial license will expire after one month. So, after that should I again need to go back to the previous license?

I mean this is really strange if I need an additional license just to integrate python with Lumerical. It must be simple as we already have integration of Matlab with Lumerical.



Hi @visvas,

As shown from the screenshot I provided on the Python Integration page, the first Requirement is the Automation API license.

Yes, the Python API module is supplied with all our design tools. But using this and integrating with our tools will require a separate license.

For MATLAB API use and integration, there is no need for any separate license.

As for the trial license you obtained from our website for Windows. This is a NODE locked license, which is the default license type for this OS. It cannot be activated using the FlexNet license manager activation utility.

From the screenshot, you Purchased a Floating License for our design tools. Unfortunately, the NODE locked license cannot be mixed with a Floating license.

Please send a request for a Floating trial license for your existing Purchased Floating License to

Hope this clarifies everything.



This is really said to know that Python integration (an open source software) required seprate license while Matlab doesn’t require it. It doesn’t make any sense for me. Anyhow one can not use Python integration without having your licenses of solver. So, it’s like visulizing something in Python is paid but in Matlab it’s free.
This request must be raise to management level to make it free.

SIncelry, nothing to cheers in this case. :frowning_face:



Please feel free to raise your request in our Ideas Exchange.

This is a portal where users can provide feedback and ideas on how to improve our tools. It will also allow other users to vote on your requests.




Hello @lyap,

I was successful in installing the MODE solutions on my Ubuntu Machine, a big Thanks for that!

Now, I am trying to run a sample python integration program to run my nanowire_build_script.lsf file in MODE solutions. Please find my file attached with this post. On running this file, I am getting the errors mentioned below.

Could you be able to tell me, what am I missing in file?

How can I check whether I have An Automation API License?

Thanks! (186 Bytes)




Sorry, as mentioned, Ubuntu is not a supported system.
Our Integration and APIs only works with Supported Systems.


Tip: Search Knowledge Exchange (click here). To answer your questions or fix your problem quickly!

Please mark this as resolved if the issue has been fixed by this post. Thanks.



Hello @lyap,

I am trying to run the “” (attached) on my Linux machine. I am getting the errors mentioned in the screenshot below. Could you please help me in understanding these errors? (554 Bytes)





Based on your screenshot you are using Ubuntu and a custom installation of MODE Solutions.


Verify if the Python Integration Status is Active when using your own installation of Python. i.e. running your Python script from Terminal.

Our API will require NumPy and SciPy. See our Knowledge Base guide for details:

Otherwise, check the box, to use our supplied Python and run your Python script from within our software, using the script file editor.

I ran the script below on Ubuntu 16.04 LTS using the default Python 2.7 that came with Ubuntu with numpy and scipy installed. MODE and FDTD were installed on the default location / installation folders.

import sys, numpy, scipy, imp
lumapi = imp.load_source("lumapi", "/opt/lumerical/mode/api/python/")
h ="mode")
# passing arguments to Lumerical
lumapi.putString(h,"string_name", "text")
lumapi.putMatrix(h, "M", [[1,2,3],[4,5,6]])
lumapi.evalScript(h, "A=x*M;")
# getting variables from Lumerical
print(B) (440 Bytes)

You will have to change the installation path for MODE Solutions on line 2 of my script to:

lumapi = imp.load_source("lumapi", " /home/aniruth/Research/MODE_Solutions-7.13.1882/opt/lumerical/mode/api/python/")

Hope this helps.


Tip: Search Knowledge Exchange (click here). To answer your questions or fix your problem quickly!

Please mark this as resolved if the issue has been fixed by this post. Thanks.


Inverse design models can't be run on Linux server

Dear @lyap,

Thank you for such a great post!

I followed the same instructions which you have specified in the post above. I am still getting the error I encountered, as mentioned in my previous post. In the attached screenshot, please have a look at the executable and the environment sections of the Python Integration window.


I need to get done with this issue as early as possible :frowning: Help me!

I have now installed Mode Solutions in the Downloads folder. I am able to open the instance of Lumerical MODE manually, but not able to open the instance through a python script. I am getting something like this:




@lyap, I somehow got the issue resolved for me. Now, I am able to run the MODE Solutions from my python script.

Thank you so much for the help. Appreciate it!

-------------------------Issue Resolved---------------------------




Glad to hear that this is resolved.
Can you please provide details on how you were able to fix the issue?




I followed the steps mentioned in How to install on Ubuntu systems.

Earlier Steps:

  1. Downloaded the MODE solution product. By default, the MODE_Solutions-7.13.1882.tar.gz is available in the Downloads directory.
  2. I copied the MODE_Solutions-7.13.1882.tar.gz folder and pasted in another directory.
  3. Ran the following commands: cd <product_installation_folder>, cd rpm_install_files,
    sudo alien -k --scripts <product_installation_package>.rpm
  4. .deb files were created after this. Next, I ran this command: sudo dpkg -i <product_installation_package>.deb
  5. Deleted the library using this command sudo rm /opt/lumerical/mode/lib/libxmlsec1.
  6. Ran my python script as mentioned in the previous post.
  7. Encountered the issues as mentioned in the post above.

Summary: I think I messed with the by default installation folder and hence I was not able to run the MODE solutions through my Python script.

Solution worked for me: I followed each and every step mentioned in the How to install on Ubuntu systems post, and did not change the directory of installation. I installed the MODE Solutions in the downloads folder.




Awesome! :clap:
Thank you so much for sharing these with us!


1 Like