Question
· Jul 10

Component registration

When registering the components: I used this command:
"Utils.migrate("/external/src/CoreModel/Python/settings.py)" ;
The error appears: "An error has occurred: iris.cls: error finding class",
I changed with these two lines:
result = subprocess.run(["iop", "-m", "/external/src/CoreModel/Python/settings.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True)
subprocess.run(["iop", "-m", "/external/src/CoreModel/Python/settings.py"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)

 also there is an error:
"An error occurred: Command '['iop', '-m', '/external/src/CoreModel/Python/settings.py']' returned non-zero exit status 1."

Could you please help me?
 

Product version: IRIS 2023.3
Discussion (2)1
Log in or sign up to continue

Hi @ala zaalouni,

When you encounter this error :

The error appears: "An error has occurred: iris.cls: error finding class"

This usually mean that the Iop framework is not loaded into iris.

pip install iris-pex-embedded-python

you must init it to iris (install the associated classes to iris), for that you must do :

iop --init

or

from iop import Utils
Utils.setup()

please refer to the documentation :

https://github.com/grongierisc/interoperability-embedded-python?tab=read...

For the more, make sure you are on the right namespace by specifying the var env : $IRISNAMESPACE