Skip to content

psi4 fails when conda installed in symlinked directory #3126

@chrisiacovella

Description

@chrisiacovella

This issue is similar to #3084. For psi4 installed via conda/mamba (both 4.18.2 and 4.19) on an hpc system that has a symlink for the /home directory (the same hpc system in the prior issue), psi4 has trouble resolving paths that don't call .resolve(). while the changes made in response to #3084 mostly fix the issue, there appears to be two other places .resolve() should be added:

psi4/psi4/__init__.py

Lines 47 to 48 in e105cc2

full_data = prefix / cmake_install_datadir / "psi4"
full_bin = prefix / cmake_install_bindir

The full error is below:

[2024-01-25 07:17:41 EST]     INFO: qcfractalcompute.config: Reading configuration data from configs/config.3049902-1.yaml
Traceback (most recent call last):
  File "/lila/home/iacovec/miniforge3/envs/qcfractalcompute/lib/python3.12/site-packages/qcfractalcompute/run_scripts/qcengine_list.py", line 12, in <module>
    progs = {x: qcengine.get_program(x).get_version() for x in qcengine.list_available_programs()}
  File "/lila/home/iacovec/miniforge3/envs/qcfractalcompute/lib/python3.12/site-packages/qcfractalcompute/run_scripts/qcengine_list.py", line 12, in <dictcomp>
    progs = {x: qcengine.get_program(x).get_version() for x in qcengine.list_available_programs()}
  File "/home/iacovec/miniforge3/envs/qcfractal-worker-psi4-18.2/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 "/home/iacovec/miniforge3/envs/qcfractal-worker-psi4-18.2/bin/psi4", line 213, in <module>
    import psi4  # isort:skip
  File "/lila/home/iacovec/miniforge3/envs/qcfractal-worker-psi4-18.2/lib/python3.10/site-packages/psi4/__init__.py", line 64, in <module>
    raise KeyError(f"Unable to read the Psi4 Python folder - check the PSIDATADIR environmental variable - current value is {str(data_dir)}")
KeyError: 'Unable to read the Psi4 Python folder - check the PSIDATADIR environmental variable - current value is /lila/home/conda/feedstock_root/build_artifacts/psi4_1696426865911/work/build/stage/share/psi4'

To decode this output a little, the failure results from qcarchive trying to get the version of psi4. The specific qcarchive code is here: https://github.com/MolSSI/QCFractal/blob/32a29a86d6673b0ea1a743b02d3af314c2fd164c/qcfractalcompute/qcfractalcompute/run_scripts/qcengine_list.py#L12

The code to query the version in qcarchive is newer than issue #3084, which is why it probably was not caught at the time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions