Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psi4 version 1.8 in conda #2991

Open
chrinide opened this issue Jun 26, 2023 · 13 comments
Open

Psi4 version 1.8 in conda #2991

chrinide opened this issue Jun 26, 2023 · 13 comments

Comments

@chrinide
Copy link

chrinide commented Jun 26, 2023

Dear all,

It seems that the manjor version in conda is still version 1.7, not the 1.8.

conda argue that:

psi4 1.8 is uninstallable because it requires libint 2.7.3dev1.*, which dose not exist

@philipmnel
Copy link
Contributor

The libint package needed is in a dev label of conda-forge. You can install psi4 1.8 with

conda install psi4 -c conda-forge/label/libint_dev -c conda-forge 

@chrinide
Copy link
Author

The libint package needed is in a dev label of conda-forge. You can install psi4 1.8 with

conda install psi4 -c conda-forge/label/libint_dev -c conda-forge 

Dear Philip,

Thanks so much for your information

@JonathonMisiewicz
Copy link
Contributor

Is there a reason this issue still needs to be open?

@chrinide
Copy link
Author

chrinide commented Jun 27, 2023

Is there a reason this issue still needs to be open?

Hi, Jonathon

conda install psi4 -c psi4 will install 1.7 version, not the 1.8.

Is there any reson that the default conda install psi4 -c psi4 not install the latest production version 1.8?

@coltonbh
Copy link

I cannot install psi4 v1.8 from conda. I get the following error. I'm on Ubuntu 22.04. Is this a known issue? Workarounds?

❯ conda create --name psi4-2 --channel conda-forge 'psi4==1.8'                                                         35s  base
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: | 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                          

UnsatisfiableError: The following specifications were found to be incompatible with each other:



Package qcengine conflicts for:
psi4==1.8 -> qcengine[version='>=0.26.0,<0.27.0a0']
Package libint conflicts for:
psi4==1.8 -> libint=2.7.3dev1
Package _openmp_mutex conflicts for:
psi4==1.8 -> _openmp_mutex[version='*,>=4.5',build=*_llvm]
Package python_abi conflicts for:
psi4==1.8 -> python_abi[version='3.10.*|3.11.*|3.8.*|3.9.*',build='*_cp311|*_cp310|*_cp38|*_cp39']
Package libxc-c conflicts for:
psi4==1.8 -> libxc-c[version='>=6.1.0,<7.0a0',build=cpu_*]
Package qcelemental conflicts for:
psi4==1.8 -> qcelemental[version='>=0.25.1,<0.26.0a0']
Package python conflicts for:
psi4==1.8 -> python[version='>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']
Package pytest conflicts for:
psi4==1.8 -> pytest[version='>=7.0.1']
Package pyddx conflicts for:
psi4==1.8 -> pyddx[version='>=0.4.1']
Package pymdi conflicts for:
psi4==1.8 -> pymdi[version='>=1.2']
Package mkl conflicts for:
psi4==1.8 -> mkl[version='>=2022.2.1,<2023.0a0']
Package dkh conflicts for:
psi4==1.8 -> dkh[version='>=1.2,<1.3.0a0']
Package adcc conflicts for:
psi4==1.8 -> adcc[version='>=0.15.16']
Package networkx conflicts for:
psi4==1.8 -> networkx
Package numpy conflicts for:
psi4==1.8 -> numpy
Package libblas conflicts for:
psi4==1.8 -> libblas=[build=*mkl]
Package pybind11-abi conflicts for:
psi4==1.8 -> pybind11-abi==4
Package gau2grid conflicts for:
psi4==1.8 -> gau2grid[version='>=2.0.7,<3.0a0']
Package msgpack-python conflicts for:
psi4==1.8 -> msgpack-python
Package llvm-openmp conflicts for:
psi4==1.8 -> llvm-openmp[version='>=16.0.3']
Package pylibefp conflicts for:
psi4==1.8 -> pylibefp==0.6.2
Package geometric conflicts for:
psi4==1.8 -> geometric[version='>=1.0']
Package libstdcxx-ng conflicts for:
psi4==1.8 -> libstdcxx-ng[version='>=12']
Package optking conflicts for:
psi4==1.8 -> optking[version='>=0.2.1,<0.3.0a0']
Package libgcc-ng conflicts for:
psi4==1.8 -> libgcc-ng[version='>=12']
Package scipy conflicts for:
psi4==1.8 -> scipy

@philipmnel
Copy link
Contributor

You're missing --channel conda-forge/label/libint_dev

@coltonbh
Copy link

Thanks so much for the quick response, @philipmnel! This does indeed make the install work; however, psi4 does not work, appearantly due to issues with pydantic v1 vs v2. Is there a fix for this? Does psi4 v1.8 support pydantic v2?

~ ❯ conda activate psi4-2                                                                                                                                                                    base
~ ❯ psi4 --version                                                                                                                                                                         psi4-2
Valid config keys have changed in V2:
* 'allow_mutation' has been removed
Traceback (most recent call last):
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/bin/psi4", line 213, in <module>
    import psi4  # isort:skip
    ^^^^^^^^^^^
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/psi4/__init__.py", line 90, in <module>
    from .driver import endorsed_plugins
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/psi4/driver/__init__.py", line 42, in <module>
    from qcelemental import constants
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/qcelemental/__init__.py", line 6, in <module>
    from . import covalent_radii, models, molparse, molutil, periodic_table, physical_constants, util, vanderwaals_radii
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/qcelemental/models/__init__.py", line 10, in <module>
    from .align import AlignmentMill
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/qcelemental/models/align.py", line 6, in <module>
    from ..util import blockwise_contract, blockwise_expand
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/qcelemental/util/__init__.py", line 1, in <module>
    from .autodocs import auto_gen_docs_on_demand, get_base_docs
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/qcelemental/util/autodocs.py", line 6, in <module>
    from pydantic import BaseModel, BaseSettings
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/pydantic/__init__.py", line 210, in __getattr__
    return _getattr_migration(attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cbh/.pyenv/versions/miniconda3-4.7.12/envs/psi4-2/lib/python3.11/site-packages/pydantic/_migration.py", line 289, in wrapper
    raise PydanticImportError(
pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.3/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.3/u/import-error
~

@philipmnel
Copy link
Contributor

I believe the patch for pydantic v2 support should be in the psi4 1.8.1 build. Try psi4==1.8.1 in your conda install.

@loriab
Copy link
Member

loriab commented Aug 29, 2023

In particular, 1.8.1 _2 is pydantic v1/v2 tolerant . likewise qcel v0.26 and qcng v0.27 and v0.28 . qcf next is pinned to pydantic v1, iirc.

There's a possibility that 1.8.2 will be pydantic v2 API if we can make a plan to do the whole qca stack at once. If that sounds appealing or alarming to anyone, please chime in.

@coltonbh
Copy link

Ok, yes the following seems to work:

~ ❯ conda create --name psi4-2 --channel conda-forge/label/libint_dev --channel conda-forge 'psi4==1.8.1'  

@loriab what do you mean by 1.8.1 _2? When I tried the following it said that such a package for psi4 does not exist:

~ ❯ conda create --name psi4-2 --channel conda-forge/label/libint_dev --channel conda-forge 'psi4==1.8.1_2'  

What am I missing?

@loriab
Copy link
Member

loriab commented Aug 30, 2023

If, upon conda list psi4 the hash-like build string ends in _2, then all's well. linux-64/psi4-1.8.1-py39hd162a35_2.conda is one such. That's probably what you got since the solver tries hard to pick the most recent build and only won't if other constraints get in the way. If you wanted to specify it directly, it'd be conda create ... 'psi4=1.8.1=*_2' to specify the version exactly and the build ending in _2. I should have been clearer.

@loriab
Copy link
Member

loriab commented Aug 30, 2023

fwiw, I've put up a table to track pydantic compatibility MolSSI/QCElemental#323

@coltonbh
Copy link

coltonbh commented Aug 31, 2023

I'm getting one other error when I try to use psi4==1.8.1 alongside some other packages. Any idea what this is about?

raised unexpected: TypeError('Error 1 retrieving Psi4 version: stdout: , stderr: Traceback (most recent call last):\n  File "/opt/conda/bin/psi4", line 213, in <module>\n    import psi4  # isort:skip\n  File "/opt/conda/lib/python3.10/site-packages/psi4/__init__.py", line 68, in <module>\n    from . import core\nImportError: /opt/conda/lib/python3.10/site-packages/psi4/core.cpython-310-x86_64-linux-gnu.so: undefined symbol: __dkh_main_MOD_dkh\n')
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/celery/app/trace.py", line 760, in __protected_call__
    return self.run(*args, **kwargs)
  File "/code/bigchem/tasks.py", line 52, in compute
    return qcop_compute(program, inp_obj, raise_exc=raise_exc, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/qcop/main.py", line 35, in compute
    return adapter.compute(
  File "/opt/conda/lib/python3.10/site-packages/qcop/adapters/base.py", line 143, in compute
    results, stdout = self.compute_results(
  File "/opt/conda/lib/python3.10/site-packages/qcop/adapters/qcengine.py", line 42, in compute_results
    qcng_output = qcng_compute(
  File "/opt/conda/lib/python3.10/site-packages/qcengine/compute.py", line 108, in compute
    output_data = executor.compute(input_data, config)
  File "/opt/conda/lib/python3.10/site-packages/qcengine/programs/psi4.py", line 141, in compute
    pversion = parse_version(self.get_version())
  File "/opt/conda/lib/python3.10/site-packages/qcengine/programs/psi4.py", line 111, in get_version
    raise TypeError(f"Error {rc} retrieving Psi4 version: stdout: {so}, stderr: {se}")
TypeError: Error 1 retrieving Psi4 version: stdout: , stderr: Traceback (most recent call last):
  File "/opt/conda/bin/psi4", line 213, in <module>
    import psi4  # isort:skip
  File "/opt/conda/lib/python3.10/site-packages/psi4/__init__.py", line 68, in <module>
    from . import core
ImportError: /opt/conda/lib/python3.10/site-packages/psi4/core.cpython-310-x86_64-linux-gnu.so: undefined symbol: __dkh_main_MOD_dkh

EDIT: The issue appears to be coming from using a psi4 channel for installation. Some of my old env.yaml files used a psi4 channel. The psi4 installation from that channel appears broken. If you install from conda-forge it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants