Skip to content

Instantly share code, notes, and snippets.

@cwebber314
Last active January 22, 2025 20:45
Show Gist options
  • Save cwebber314/454de95945fdb0bca3b2dae5a94793c4 to your computer and use it in GitHub Desktop.
Save cwebber314/454de95945fdb0bca3b2dae5a94793c4 to your computer and use it in GitHub Desktop.
PSSE Environment Debug Notes

PSSE Environment Debug

Sometimes a PSSE won't open after install. This is almost always caused by an unexpected Python configuration.

If you're struggling with MOD, see the MOD Debug Notes

Debug: Instant close

Behavior:

  • Start PSSE
  • result: PSSE splash screen appears, then PSSE instantly closes.

This one is painful because there are no error message. The best way to get some usable error messages is to run PSSE in the command line.

Open cmd.exe then run this command a command like one of these:

"C:\Program Files\PTI\PSSE35\35.4\PSSBIN\pssecmd35.exe"
"C:\Program Files\PTI\PSSE35\35.5\PSSBIN\pssecmd35.exe"
"C:\Program Files\PTI\PSSE35\35.6\PSSBIN\pssecmd35.exe"

If you see a python error about the encoding library, this section is for you.

This seems to happen because PSSE doesn't know how to find the encoding library.

Or by setting the PYTHONHOME variable:

SET PYTHONHOME=c:\Python39

You can also fix this by setting the PYTHONPATH variable:

SET PYTHONPATH=c:\Python39\Lib

In this example the encodings library is installed in C:\Python39\Lib\encodings - which is why the environment fixes work.

Make sure you set your user variables not the system variables. To set env variables see Google

In general, it's a bad idea to set PYTHONPATH or PYTHONHOME - python should know how to find it's packages. This is a dirty workaround for PSSE. Setting the env variables globally is fine for testing, but please don't set these globally if you want any other python script to behave normally. Instead run PSSE from a bat file that looks like this:

SET PYTHONHOME=c:\Python39
start "" "C:\Program Files\PTI\PSSE35\35.4\PSSBIN\PSSE35.exe" %*

The Sneaky Python

When you start PSSE it adds the the PATH found in this registry key to your python sys.path:

> reg query HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.9\InstallPath

HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.9\InstallPath
    (Default)    REG_SZ    c:\Python39\

If this registry entry points to the incompatible version of Python it will probably cause issues.

PATH env variable

PSSE seems to ignore the PATH env variable when it looks for the python install it's going to use.

32bit python - Error 193

If the registry points to a 32bit python instead of 64 bit, you get the error:

python load failed with error code 193

Wrong python version - Error 126

If the registry points to the wrong python version such as python 3.11 when PSSE expects python 3.9, you get the error:

python load failed with error code 126

How do you know which version of Python PSSE wants to use? Start the PSSE Installer and check what version it wants to install

PSSE 35.6 requires Python 3.11.9 64bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment