I've recently started using the psi4 quantum chemistry software. I wanted to compare a couple of different basis sets (mainly pople style) on an amino acid. So I've written a python code inside the input file to iterate over the different sets.But only the first loop runs and the second fails miserably giving an error code:

PSIO_ERROR: Attempt to write into next entry: 35, SO-basis Overlap Ints
PSIO_ERROR: unit = 35, errval = 18
PSIO_ERROR: 18 (Incorrect block end address)
Traceback (most recent call last):
File "<string>", line 42, in <module>
File "/usr/share/psi/python/driver.py", line 617, in energy
procedures['energy'][lowername](lowername, **kwargs)
File "/usr/share/psi/python/proc.py", line 1231, in run_scf
scf_helper(name, **kwargs)
File "/usr/share/psi/python/proc.py", line 1457, in scf_helper
e_scf = psi4.scf(precallback, postcallback)
RuntimeError: PSIO Error

here is my code:

basis_sets = ["6-31G", "6-31G*", "6-31G**"]
for basis_set in basis_sets:
    set basis =  $basis_set

I've tried to run it without the code and there was no problem. I copied the code from the psi4 tutorial page for python scripting Thanks for the help.

  • 1
    $\begingroup$ I guess this may be borderline off-topic here. However, please provide the complete input file which failed with along with the version and other parameters necessary to reproduce the problem. Have you tried using the original example with Dunning's basis sets? This error looks quite cryptic and I have no experience. Have you tried substituting the alias 6-31G* with the equivalent 6-31G(d)? I can't be sure, but maybe the asterisk is causing some kind of trouble. You can edit in more information, alternatively you might want to consider asking this on a more computational site. $\endgroup$ Feb 10, 2017 at 11:45
  • $\begingroup$ I tried running these basis sets individually without the loop and they worked fine. The other part is just an .xyz file with my molecule nothing special. $\endgroup$ Feb 10, 2017 at 12:00
  • 1
    $\begingroup$ Well, apparently there is something wrong with the loop then. Please provide the information I have asked for. This is already borderline off-topic and as it is not reproducible it basically is of no further use in the future. (Be aware that the community might decide to close this question.) It would also be helpful if you could try what I suggested, as I have a gut feeling that the python bit does not recognise the alias what the global program probably does. $\endgroup$ Feb 10, 2017 at 12:08
  • $\begingroup$ I tried to run the different basis sets under different aliases and it recognizes them. I'll couldn't find the source of the problem, and I guess that for now I'll have to run them manually. $\endgroup$ Feb 12, 2017 at 9:41
  • 2
    $\begingroup$ If it solves your problem, feel free to add an answer. $\endgroup$ Feb 12, 2017 at 9:43

1 Answer 1


Here is an input file that will reproduce this error:

molecule {
    b      0.0000        0.0000        0.0000
    h      0.0000        0.0000        1.0000

basis_sets = ["6-31G", "6-31G*", "6-31G**"]
for basis_set in basis_sets:
    set basis = $basis_set

The problem is that Psi4 sees there are files remaining in scratch that it can use, starting with the spin orbital-basis overlap integrals, but because the basis set has changed, the file is the wrong size. You'll need to clean these up after the energy call by adding clean() within the loop.

  • $\begingroup$ So just by adding clean() after the energy ('scf') the problem will be solved? $\endgroup$ Aug 7, 2017 at 16:20
  • $\begingroup$ Yes, try it for yourself $\endgroup$ Aug 7, 2017 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.