Ask Your Question
0

psspy couldnt be resolved

asked 2023-12-15 07:32:20 -0500

anonymous user

Anonymous

updated 2023-12-15 10:13:55 -0500

jconto gravatar image

hi, I am trying to run a python code in visual studio. I am getting an error 'import psspy could not be resolved'. Although my code is running. Then why I am seeing this issue? used the following:

import os
import sys
psse_dir = r"C:\Program Files\PTI\PSSE35\35.5\PSSBIN"
sys.path.append(psse_dir)
os.environ['PATH'] = os.environ['PATH'] + ';' +  psse_dir

py_dir = r"C:\Program Files\PTI\PSSE35\35.5\PSSPY37"
sys.path.append(py_dir)
os.environ['PATH'] = os.environ['PATH'] + ';' +  py_dir

import psse35
import psspy
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2023-12-15 14:53:50 -0500

jconto gravatar image

The code works fine. The error could be related to the selection of python version in your set-up.
On the Visual Studio Code screen, click on the word "TERMINAL" on the lower menu, to activate the terminal box (behaves as a DOS windows) and then click on the version number next to "Python" on the 'new' menu on the bottom right side of the screen. Now you will see and select the right python version. For PSSe35, select python 3.7.x 64-bit. [In my setup, I use PSSe v.35.6 with python 3.9]

image description

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: 2023-12-15 07:32:20 -0500

Seen: 1,458 times

Last updated: Dec 15 '23