TypeError when importing Psi4 into Python

Hello,

I am on Windows 10, and I installed Psi4 v1.6.0 (stable release) using Anaconda. To walk you through what I did, I installed Psi4 by typing the following into the Anaconda prompt:

conda create -n p4 psi4 python=3.8 -c psi4 -c conda-forge

I then activated the environment and ran psi4 --test. Here is the result:

Traceback (most recent call last):
File “C:\Users\Moe\anaconda3\envs\p4\Scripts\psi4-script.py”, line 187, in
import psi4 # isort:skip
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4_init_.py”, line 76, in
from .driver import endorsed_plugins
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver_init_.py”, line 46, in
from psi4.driver.molutil import *
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\molutil.py”, line 36, in
from psi4.driver.p4util import temp_circular_import_blocker
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\p4util_init_.py”, line 32, in
from .util import *
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\p4util\util.py”, line 37, in
from psi4.driver.procrouting import *
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting_init_.py”, line 29, in
from .proc_table import procedures, hooks, energy_only_methods, integrated_basis_methods
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\proc_table.py”, line 32, in
from . import sapt
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\sapt_init_.py”, line 29, in
from .sapt_proc import run_sapt_dft, sapt_dft, run_sf_sapt
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\sapt\sapt_proc.py”, line 36, in
from psi4.driver.procrouting.proc import scf_helper
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\proc.py”, line 55, in
from . import proc_util
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\proc_util.py”, line 38, in
from psi4.driver.procrouting.sapt import fisapt_proc
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\sapt\fisapt_proc.py”, line 34, in
from … import empirical_dispersion
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\procrouting\empirical_dispersion.py”, line 38, in
from psi4.driver import driver_findif
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\driver_findif.py”, line 153, in
from psi4.driver.task_base import AtomicComputer, BaseComputer, EnergyGradientHessianWfnReturn
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\task_base.py”, line 67, in
class AtomicComputer(BaseComputer):
File “C:\Users\Moe\anaconda3\envs\p4\lib\site-packages\psi4\driver\task_base.py”, line 75, in AtomicComputer
keywords: Dict[str, Any] = Field(default_factory=dict, description=“The keywords to use in the computation.”)
TypeError: Field() missing 1 required positional argument: ‘default’

Does anyone know what can be causing this TypeError? As far as I know, this error generally comes up when trying to call a method of a class which has not been instantiated, where in this case, the class is Field(), which belongs to the pydantic package. But I’m not sure how to go about correcting this.

In case it may be useful, here is what I get when I run psi4 --psiapi:

export PATH=C:/tools/miniconda3:$PATH # python interpreter
export PATH=C:\Users\Moe\anaconda3\envs\p4\bin:$PATH # psi4 executable
export PYTHONPATH=C:\Users\Moe\anaconda3\envs\p4\lib/:$PYTHONPATH # psi4 pymodule

Same issue as here. Have conda-forge before psi4 in channel order.

I’ll get in touch with Lori to have the website download instructions updated.

Thank you. This fixed the problem.