I am installing psi4 in a fresh conda environment using “conda install psi4 -c psi4” and keep getting the following error:
(psitest) vlita@vlita-ThinkPad-T490:~/Desktop/rsrch$ python psi4_test.py
/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/pydantic/_internal/_config.py:321: UserWarning: Valid config keys have changed in V2:
‘allow_mutation’ has been removed
warnings.warn(message, UserWarning)
Traceback (most recent call last):
File “/home/vlita/Desktop/rsrch/psi4_test.py”, line 1, in
import psi4
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/psi4/init.py”, line 75, in
from .driver import endorsed_plugins
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/psi4/driver/init.py”, line 42, in
from qcelemental import constants
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/qcelemental/init.py”, line 6, in
from . import covalent_radii, models, molparse, molutil, periodic_table, physical_constants, util, vanderwaals_radii
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/qcelemental/models/init.py”, line 10, in
from .align import AlignmentMill
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/qcelemental/models/align.py”, line 6, in
from …util import blockwise_contract, blockwise_expand
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/qcelemental/util/init.py”, line 1, in
from .autodocs import auto_gen_docs_on_demand, get_base_docs
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/qcelemental/util/autodocs.py”, line 6, in
from pydantic import BaseModel, BaseSettings
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/pydantic/init.py”, line 363, in getattr
return _getattr_migration(attr_name)
File “/home/vlita/anaconda3/envs/psitest/lib/python3.10/site-packages/pydantic/_migration.py”, line 296, in wrapper
raise PydanticImportError(
pydantic.errors.PydanticImportError: BaseSettings has been moved to the pydantic-settings package. See Migration Guide - Pydantic for more details.
Please use conda install psi4 -c conda-forge as outlined at Install v1.9.1+ | Installs with “conda” selection. (The psi4 channel is still maintained but mostly for the psi4 and libint packages itself, and all deps need to be from c-f.)
Fwiw, psi4 can be used with pydantic v1 or v2 packages; it uses the v1 API importable from v2 package in the latter case.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- psi4
Current channels:
- https://conda.anaconda.org/conda-forge/linux-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Just a Psi4 amateur here, but it looks like you’re using the old Conda solver… Did you install Conda with apt (it’s really out of date)?
Our research group has seen similar issues with older versions of Conda, so perhaps ensuring that you’re on the latest version or that you’re using libmamba would help.
Yes, I have similar issues on some research computing systems. It’s been difficult to get Psi4 running, and there’s nothing I can do about the versions on these systems. Installing libmamba isn’t always an option (ex, if you can’t install global conda packages).
The above should be conda create not conda install since it’s a lot easier to solve the environment afresh rather fit into the constraints of an existing environment.
When I use conda create with your command, at the moment, it’s solvable. My conditions are below for reference.
But I’ve been using the mamba solver exclusively for nearly a year, so I bet @kb1rd’s is a good lead to switch from the classic solver to the mamba solver. Since it can be confusing, I’ll mention that (1) since Fall 2023, the default solver for conda is libmamba and (2) for a while before that, one could install an extra package into the base environment and then use libmamba as the solver backend for conda.
@kb1rd is also right that all the preceding is for naught if you can’t edit your base environment. We have the same problem at our university cluster. In this case, you might consider using the installer (linux/installer/3.10/1.9.1 at Install v1.9.1+ | Installs). It’s a bigger download, but it will give a full installation. Because the conda it provides is recent, you’ll also get the mamba solver backend.
I actually created the env first and tried to install. But to make sure, I did go ahead and run: conda create --name psi4env_1-9-1 psi4 python=3.10 -c conda-forge
Same error:
PackagesNotFoundError: The following packages are not available from current channels:
- psi4
I did successfully install libmamba but, as you can see, it does not show up in ‘user-agent’ and I get: conda: error: unrecognized arguments: --solver=libmamba
when trying to use it as the solver. So, at thsi point I am thinking I need to update conda:
conda update -n base conda
Yes?
However, it does not seem like an update version of psi4 is going to directly solve my current issue.