Psi4 has an input file mode of operation molecule {...} known as Psithon and a python mode of operation psi4.geometry("""...""") known as PsiAPI. The latter requires proper Python namespacing that is hidden away from user in Psithon. So you often need to add psi4 (py driver) or psi4.core (export from C++) to calls. The above works.