Ask Your Question

lleb's profile - activity

2016-12-26 18:03:44 -0500 received badge  Student (source)
2016-08-03 01:31:40 -0500 received badge  Popular Question (source)
2016-08-03 01:31:40 -0500 received badge  Notable Question (source)
2016-08-03 01:31:40 -0500 received badge  Famous Question (source)
2016-08-01 16:15:29 -0500 answered a question How do I import the psspy module in a Python script?

this is more of a follow up question: I am getting the following error with your code:

 Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
====================== RESTART: C:\Python27\program1.py ======================

Traceback (most recent call last):
  File "C:\Python27\program1.py", line 7, in <module>
    import psspy
ImportError: No module named psspy

I copied and pasted your code and only added 1 single line and adjusted the path:

import os,sys

PSSE_LOCATION = r"C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN"
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + ';' +  PSSE_LOCATION 

import psspy

psspy.psseinit(50)

What am I missing? FYI I do not have a psspy.py in that directory, but do have psspy.pyc and psspyc.pvd in: C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27

When I run with that path i get the following error:

====================== RESTART: C:\Python27\program1.py ======================

Traceback (most recent call last):
  File "C:\Python27\program1.py", line 7, in <module>
    import psspy
  File ".\psspy.py", line 56, in <module>
ImportError: DLL load failed: The specified module could not be found.

I find both rather confusing and offering little in the way of help with their error messages. Am I missing a DLL file or more, or is psspy just no longer provided with PSSEXplore?

2016-07-31 22:20:22 -0500 asked a question ImportError: DLL Load failed:...

Sadly I am not sure how to load screen shots for this so I hope my explanation is clear.

I have a fresh install of the student vs. of PSSe with Python. I am attempting to teach myself how to use them. There are some very good video tutorials out there, but none of them address this type of issue.

I am running win7 (yeah i know MS Windows is not the best for programming, but hey its what companies use, so its what I am learning on) and PSSE 34 with I believe python 2.7.

I have verified the path of psse: C:\program files (x86)\pti\pssexplore34\

I found psspy.pvc and psspy.pyd in the psspy27 sub-directory of above. All I am attempting to perform right now is to get python to call psspy and run a simple 100 node example file.

following this video: https://www.youtube.com/watch?v=nHrAA...

My script looks as follows:

`import os

import sys

PSSE_PATH = r"C:\Program Files (x86)\PTI\PSSExplore34\PSSPY27"
sys.path.append(PSSE_PATH)
os.environ['PATH'] += ';' + PSSE_PATH

import psspy

psspy.psseinit(100)`

when I run the above script I get the following output from python shell:

 ====================== RESTART: C:/Python27/program1.py ======================

Traceback (most recent call last):
  File "C:/Python27/program1.py", line 8, in <module>
    import psspy
  File ".\psspy.py", line 56, in <module>
ImportError: DLL load failed: The specified module could not be found.

Sorry to be a bother, but next? What DLL is missing, were do I get said DLL, and how do I resolve this error so I can start to practice?

Thank you in advance.