Problems installing psi4

Hello everyone,

I have been having trouble getting psi4 to work on my laptop. I had it installed and working, except I could not call it in python. I decided to attempt to reinstall it to see if that would be a quick fix, but since I reinstalled, psi doesn’t work at all. It could be that I am just new to computers and don’t know how to work around simple problems… but I don’t know what else to do. I keep on getting the following message when trying to use a psi executable or demo:

File “”, line 9
export PSI_SCRATCH=/path/to/existing/writable/local-not-network/directory/for/scratch/files
^
SyntaxError: invalid syntax

This is also the error message I get every time I reinstall Psi now. I’ve tried manually changing the bashrc as well and I get the same error message. If anyone knows what is going wrong or what I am doing, I would really appreciate the help!

First, welcome to the forums. Second, I’ll need a bit more information about exactly what you are trying to do. I’m slightly confused because:

export PSI_SCRATCH=<stuff>

is Bash syntax, not Python. In Python you set an environment variable like:

import os
os.environ['PSI_SCRATCH_DIR'] = "/my/scratch/dir/path"

If you are just trying to run Psi4, I recommend starting with the binary. See this link for more info:

Once you have the binary, you create an input script (or can use one of the ones in the tests directory) and then you just run from a Linux/Mac terminal:

psi4 /path/to/input/script

If you are trying to run Psi4 from within a Python script:

import os
os.system("/path/to/miniconda/bin/psi4 /path/to/input/script")

Now if you are trying to use Psi4 as a Python module, that’s a whole other can of worms…