Error when executing python file generated from .psimsch file

User: "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?

Find more posts tagged with

Sort by:
1 - 6 of 61
    User: "VSiddhartha"
    Altair Employee

    Hi,

    May I know which version of python you are using?

    Please try this tutorial

    image.png

    Thank you,

    Vishwanatha Siddhartha

    User: "Mario_Steiner"
    Altair Community Member
    OP

    I use version 3.11.5

    User: "VSiddhartha"
    Altair Employee

    Hi,

    It should be 3.8 or above.

    image.png

    Requirements and procedure available in tutorial.

    Please go through once.

    Thank you,

    Vishwanatha Siddhartha

    User: "Mario_Steiner"
    Altair Community Member
    OP

    3.11 is above 3.8?!?

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

    User: "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.

    image.png