First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

Does Python 3.6 can work with psse

asked Aug 24 '18

Gary22212 gravatar image

updated Sep 3 '18

Dear everyone,

I know PSSe33 was built as a 32-bit application. and python2.7 of 32-bit works fine with PSSe33.04 in my work.

Does anyone know can PSSe work with python 3.6 of 32-bit? I tried but failed, the problem first happened at "import psspy", and the console indicates "bad magic number in psspy..."

Maybe there are problems in my settings, or there are restrictions in PSSe version?

And I also failed to make python of 64-bit (either 3.6 or 2.7) work with PSSe.

Thanks in advance!

Gary

2 answers

Sort by » oldest newest most voted
1

answered Sep 3 '18

jfconroy gravatar image

Hello Gary,

As far as I know, the Python modules for PSSE are compiled in v2.X of Python (note how there are numerous *.pyc files in the installation directories). Therefore, I doubt that everything will work correctly in Python v3.X.

link

Comments

Thank you jfconroy, yes now in my experience, only v2.X, 32 bit of Python can work with PSSe API.

Gary22212 gravatar imageGary22212 (Sep 3 '18)
1

Psse v.34.4 also installs python 3.4 in addition to v.2.7, while PSSe v33 only install python 2.7 therefore other python versions would give the 'magic number' error when trying to load PSSe pyc modules.

jconto gravatar imagejconto (Sep 4 '18)

Good to know that! Thank you, Mr Conto.

Gary22212 gravatar imageGary22212 (Sep 4 '18)

@jconto How to ammend the magic number error then with psse v.33.4?

Sanij gravatar imageSanij (May 29 '0)

Do not open a case by double-clicking on its icon. Instead, for any v.33.x, select the PSSe link icon launcher and right-click to open its 'Properties' panel. On the 'Target' field enter ""C:\Program Files (x86)\PTI\PSSE33\PSSBIN\psse33.exe" -pyver 27", then click 'Apply'

jconto gravatar imagejconto (May 29 '0)
1

answered May 29 '0

jconto gravatar image

Psse v.34.7 installs *.pyc modules for python v.3.7 and v.3.4, in addition to v.2.7, while PSSe v33 only install *.pyc modules for python 2.7 therefore other python versions (v.3.6, etc.) would give the 'magic number' error when trying to load PSSe pyc modules.

To assign a specific python version to PSSe I have separate launching link icons.

for PSSe v.34.7 + python v.3.7, select a PSSe link icon launcher (named PSSE3437) and right-click to open its 'Properties' panel. On the 'Target' field enter ""C:\Program Files (x86)\PTI\PSSE34\PSSBIN\psse34.exe" -pyver 37", then click 'Apply'

for PSSe v.34.7 + python v.2.7, select a PSSe link icon launcher (named PSSE3427) and right-click to open its 'Properties' panel. On the 'Target' field enter ""C:\Program Files (x86)\PTI\PSSE34\PSSBIN\psse34.exe" -pyver 27", then click 'Apply'

link

Comments

Thank you so much for your reply. Just have a little concerned, it seems that PSSe v.34.7 only works with python v.3.x in 32-bit version? So challenge still remains in interacting Pss/e with new python packages e.g.deep learning, which only available in py 3.6+ 64-bit version.

Gary22212 gravatar imageGary22212 (Jun 11 '0)

E.g, if we train a control module for the system, we need to keep interacting data with deep learning models and PSS/E packages for thousands of episodes. Thus the barrier exists. An expedient method is to use subprocess, but it would greatly decrease program efficiency. ...Thank you for your reply!

Gary22212 gravatar imageGary22212 (Jun 11 '0)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

2 followers

Stats

Asked: Aug 24 '18

Seen: 2,957 times

Last updated: May 29 '20