Ask Your Question
0

Python 3.7 with PSSE 34 syntax error

asked 2024-09-24 21:01:04 -0500

likethevegetable gravatar image

updated 2024-09-25 08:41:05 -0500

I ensured Python 3.7 is 32-bit and am trying to run it with PSSE 34, but am encountering the following error. Any thoughts? I printed out the Python version and psspy file location psspy.version_info.

Note: I've tried removing Python27-related paths from the environment variables to no avail. I confirmed they are successfully remoed.

os.environ['PATH'] = os.environ['PATH'].replace('C:\\Python27\\Scripts\\;','').replace('C:\\Python27\\;','')

Troubleshooting: showing sys.version, and psspy file path
sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
C:\Program Files (x86)\PTI\PSSE34\PSSPY37\psspy.pyc
Starting single Dynamics

 PSS(R)E Version 34
 Copyright (c) 1976-2024
 Siemens Industry, Inc.,
 Power Technologies International                            (PTI)
 This program is a confidential  unpublished  work  created  and  first
 licensed in 1976.  It is a trade secret which is the property of  PTI.
 All use,  disclosure,  and/or reproduction not specifically authorized
 by  PTI  is prohibited.   This  program is protected  under  copyright
 laws  of  non-U.S.  countries  and  by  application  of  international
 treaties.  All  Rights  Reserved  Under  The  Copyright  Laws.

  File "C:\Python37\lib\site.py", line 177
    file=sys.stderr)
        ^
SyntaxError: invalid syntax
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2024-10-07 21:41:03 -0500

payamt gravatar image

Funny enough, was recently facing the same issue. Make sure to import psse34 before importing psspy in your script. Otherwise it tries to import the py2.7 version for some reason.

edit flag offensive delete link more

Comments

Wow, THANK YOU!

likethevegetable gravatar imagelikethevegetable ( 2024-10-29 12:13:20 -0500 )edit
0

answered 2024-09-26 17:09:19 -0500

jconto gravatar image

A "python-install" file like site.py should be free from errors. My guess is that it got bad during the installation. I will recommend to re-install PSSe after deleting the c:\python37 folder.

edit flag offensive delete link more

Comments

The syntax error is due to what I believe, is a Python 2.7 process being executed by psspy (since in Py2.7 print is a statement not a function call)? If that makes sense.

likethevegetable gravatar imagelikethevegetable ( 2024-09-27 10:42:46 -0500 )edit

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: 2024-09-24 21:01:04 -0500

Seen: 164 times

Last updated: Oct 07