Error when executing python file generated from .psimsch file

Mario_Steiner
Mario_Steiner Altair Community Member

I generated a .py file using the "Save as Python Code" function in the "File" tab.

When i want to run this .py file then, i recieve the error:

from .Psim_Class import PSIM

ImportError: bad magic number in 'psimapipy.Psim_Class': b'U\r\r\n'

I executed the Altair_PSIM_2024.1\Python\Source\dist\psimapipy-2024.0-py3-none-any.whl and the .bat files in Altair_PSIM_2024.1\Python\Source\

Did i mess up the installation?

Tagged:

Answers

  • VSiddhartha
    VSiddhartha
    Altair Employee

    Hi,

    May I know which version of python you are using?

    Please try this tutorial

    Thank you,

    Vishwanatha Siddhartha

  • Mario_Steiner
    Mario_Steiner Altair Community Member

    I use version 3.11.5

  • VSiddhartha
    VSiddhartha
    Altair Employee

    Hi,

    It should be 3.8 or above.

    Requirements and procedure available in tutorial.

    Please go through once.

    Thank you,

    Vishwanatha Siddhartha

  • Mario_Steiner
    Mario_Steiner Altair Community Member

    3.11 is above 3.8?!?

    My problem is nor understanding the python code but the correct installation of psimapipy

  • VSiddhartha
    VSiddhartha
    Altair Employee

    Hey, I am sorry. You are using correct version.

  • Just in case something is wrong with installation, please navigate to Options » Set Path… » Install psimapipy and browse to your python.exe.