Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Python 2.3 on PSSE 30

The following is asked on behalf of @Fagundes I've migrated it from here: http://forum.whit.com.au/psse-help-forum/question/122/how-do-i-import-the-psspy-module-in-a-python?answer=262#post-id-262

Hi.

I'm using PSS/E version 30 and using python 2.3 to program it. Can I use a newer version of python? Is it compatible? I use the code written by JervisW. The code written by me is:

import os,sys

PSSE_LOCATION = r"D:\COMPONENTE_LOGICA\PSSE\PSSE30\PSSBIN"

sys.path.append(PSSE_LOCATION)

os.environ['PATH'] = os.environ['PATH'] + ';' +  PSSE_LOCATION 

import psspy

print sys.path

Although python reports the following message:

Traceback (most recent call last):

  File "D:\ISEL\TESE\zTestes_python\Testes\teste.py", line 8, in -toplevel-
    import psspy

ImportError: DLL load failed: The specified module could not be found.

If I write the same code but without import pssy, python prints the following paths:

['D:\\ISEL\\TESE\\zTestes_python\\Testes', 
 'D:\\COMPON~1\\PYTHON_2.3\\Lib\\idlelib', 
 'C:\\Windows\\system32\\python23.zip',
 'D:\\COMPON~1\\PYTHON_2.3',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\DLLs',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib\\plat-win',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib\\lib-tk',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib\\site-packages',
 'D:\\COMPONENTE_LOGICA\\PSSE\\PSSE30\\PSSBIN']

So he add the path of PSS/E. Can someone tell me what problem might be? I check for a psspy.dll and it exits. But there is no more files with the name psspy.