Ask Your Question
0

import psse to python

asked 2018-03-27 08:07:38 -0500

YI-WEI gravatar image

updated 2018-03-27 08:12:30 -0500

Is PSSE33 connected to python, does python2.7 have to be 32-bit or 64-bit? Because I try 32-bit it can work, 64-bit cannot. In addition, PSSE and python connection only need to install PYWIN32? Because recently to help install a new computer, a bit forget how to do before

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2018-03-27 10:07:45 -0500

jconto gravatar image

PSSe33 was built as a 32-bit application. Anything 32-bit will be compatible with it. Some 64-bit apps or OS can handle interactions with 32-bit apps. Yes, install pywin32. You can use pip (located at the scripts folder of the python installation) to install python modules.

in a DOS windows: c:..>pip install pyapp_name

edit flag offensive delete link more

Comments

So python 64-bit may not work?

YI-WEI gravatar imageYI-WEI ( 2018-03-28 08:32:38 -0500 )edit

You are welcome to try it but at least you know that python-32 bit works with PSSe.

jconto gravatar imagejconto ( 2018-03-28 09:18:35 -0500 )edit

Hello, why cannot I import psspy in python after pip install pywin32?

Linzhi gravatar imageLinzhi ( 2018-04-05 20:18:35 -0500 )edit

pywin32 should not affect psspy loadability. can you share the first lines of code before attempting to load psspy?

jconto gravatar imagejconto ( 2018-04-05 20:42:13 -0500 )edit

I just typed in "import psspy", but got "No Module name psspy". Besides, Jose I have some other more urgent questions that I am looking forward to guidance, could I send you emails for help?

Linzhi gravatar imageLinzhi ( 2018-04-05 20:47:21 -0500 )edit
0

answered 2019-09-11 10:39:12 -0500

drsgao gravatar image

psspy in PSSE v33 is a 32-bit pyd and it won't work if you use a 64-bit Python interpreter to run it.

There is a workaround. You can call Python 32-bit interpreter in your 64-bit interpreter.

The post is here : https://stackoverflow.com/questions/2...

But you may need to change the "Version" to the full path of your 32-bit Python.

Example:

import execnet

def call_python_version(Version, Module, Function, ArgumentList):
        gw      = execnet.makegateway("popen//python=%s" % Version)
        channel = gw.remote_exec("""
            from %s import %s as the_function
            channel.send(the_function(*channel.receive()))
        """ % (Module, Function))
        channel.send(ArgumentList)
        return channel.receive()

result = call_python_version(r"C:\Python27\python.exe", "psspy", "case",  
                                 ['<path to your SAV file>'])    
print(result)

This code should print the errorcode from psspy.case()

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2018-03-27 08:07:38 -0500

Seen: 353 times

Last updated: Sep 11