Solved

import zosapi crashes jupyter kernel, how can I fix it?

  • 14 July 2022
  • 3 replies
  • 117 views

Badge +1

Hello!

I’m attempting to use the ZOS-API in Python (3.8.13). I’ve been running my code from the terminal window and have successfully executed a batch ray trace. I’m working on something that could benefit from using an interactive environment, so I am trying to use a Jupyter notebook or interactive cells in VS code.

When I try to run <import zosapi> the kernel dies immediately. One of the errors thrown is

“Unhandled Exeption: System.IO.FileNotFoundException: Could not load file or assembly ‘ZOSAPI_Interfaces, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified”

Am I missing a ZOSAPI_Interfaces file? Has anyone encountered this error before?

Thanks,
Jaren

icon

Best answer by MichaelH 14 July 2022, 18:58

View original

3 replies

Userlevel 6
Badge +2

Hi Jaren!

Could you share a snippet of your code so I see how you are loading and defining the API? It sounds like you are using the Python zosapi library instead of the pre-provided boilerplate, but I want to make sure. It would be useful to see everything up to your definition of TheSystem. 

Userlevel 6
Badge +2

Hi Jaren,

Also, are you using Jupyter or JupyterLab?  How did you install Jupyter/JupyterLab?  Did you install both zosapi and jupyter from pip with the same installation of Python or are you using an IDE to install Jupyter/JupyterLab?

Badge +1

Hi pardon me for responding so late, just got a notification that the above comment was chosen as the best answer.

I was just using jupyter, though the same behavior is seen when I use Jupyterlab and ipython notebooks in VS Code. All were installed with the Anaconda navigator, and I pip installed the zosapi in the same conda environment.

Reply