I'm trying to use psspy and always I get the same error: bad magic number in 'psspy': b'\x03\xf3\r\n'. Someone can help me to fix this error?
I'm using PSSe 35.3 and PSSPY39
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
I'm using PSSe 35.3 and PSSPY39
The Python version which is by default used in windows can be seen by typing the following in cmd window:
python
If you open the PSSE installation folder, you should have the same version of PSSPY folder, otherwise, the bad magic error happens.
For example, if you are using Python 3.11, you must have PSSPY311 in the PSSE installation folder (C:\Program Files\PTI\PSSE35\35.6\PSSPY311), other wise, running the Py script won't be successful.
One trick would be to delete all non-relevant Python versions from your computer by control panel/remove programs
Can you post a few lines of your python code up to the line causing the error to occur?
When opening a sav file by double-clicking on its name/icon, make sure it is set to use PSSe v.35 and then your python 3.9 scripts would run fine. If not, open PSSe GUI from the link provided during installation, open your case, then run your script.
When loading/running compiled code (*.pyc), make sure it was compiled with python 3.9
If you got access to the python source code, delete its pyc version.
The python interpreter version must be the same as the version of psspy, otherwise you'll get ImportError. Since you are using psspy39, you will need to use python 3.9 (32-bit).
Asked: 2022-10-25 15:53:52 -0600
Seen: 2,480 times
Last updated: Jul 02