Segmentation fault after install

So I recently installed Psi4 1.3.2 for macOS with Python 3.7 from the installer, but I’ve been having a lot of problems. Now I can’t say I installed Psi4 exactly as directed at the download site, I instead downloaded the file, then ran:

zsh Psi4conda-1.3.2-py37-MacOSX-x86_64.sh -b -p /usr/local/psi4/psi4conda

After that I ended up following the instructions at the Psi4 manual instead, and put

export PATH=/usr/local/psi4/psi4conda/bin:$PATH into my .zprofile, and restarted the shell.

I went to run psi4 --test, but this always gave the the output:

 ============================================== test session starts ==============================================
 platform darwin -- Python 3.7.3, pytest-4.5.0, py-1.8.0, pluggy-0.11.0 -- /usr/local/psi4/psi4conda/bin/python
 cachedir: .pytest_cache
 rootdir: /usr/local/psi4
collecting ... zsh: segmentation fault  psi4 --test

Hoping to correct my mistakes, I ran the line from the download site:

echo $'. usr/local/psi4conda/etc/profile.d/conda.sh\nconda activate' >> ~/.zprofile

This cause a lot of problems initially, I think because I forgot the first / in /usr, which I have since corrected, but I’ll include the output when I restarted the shell:

/Users/wane/.zprofile:.:13: no such file or directory: usr/local/psi4/psi4conda/etc/profile.d/conda.sh

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

   $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

And so I ran conda init zsh, which did the following:

no change     /usr/local/psi4/psi4conda/condabin/conda
no change     /usr/local/psi4/psi4conda/bin/conda
no change     /usr/local/psi4/psi4conda/bin/conda-env
no change     /usr/local/psi4/psi4conda/bin/activate
no change     /usr/local/psi4/psi4conda/bin/deactivate
no change     /usr/local/psi4/psi4conda/etc/profile.d/conda.sh
no change     /usr/local/psi4/psi4conda/etc/fish/conf.d/conda.fish
no change     /usr/local/psi4/psi4conda/shell/condabin/Conda.psm1
no change     /usr/local/psi4/psi4conda/shell/condabin/conda-hook.ps1
no change     /usr/local/psi4/psi4conda/lib/python3.7/site-packages/xonsh/conda.xsh
no change     /usr/local/psi4/psi4conda/etc/profile.d/conda.csh
modified      /Users/wane/.zshrc

==> For changes to take effect, close and re-open your current shell. <==

and it put the following in .zshrc (which had previously not existed as I prefer .zprofile):

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/psi4/psi4conda/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/usr/local/psi4/psi4conda/etc/profile.d/conda.sh" ]; then
        . "/usr/local/psi4/psi4conda/etc/profile.d/conda.sh"
    else
        export PATH="/usr/local/psi4/psi4conda/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

This looks more or less like what I already had in my .zprofile. After I restarted my shell, the terminal prompt has now changed:

It previously said username@computername directory %,
but now it says (base) username@computername directory %.

In the end psi4 --test still gives the same error:

===================================================== test session starts ======================================================
platform darwin -- Python 3.7.3, pytest-4.5.0, py-1.8.0, pluggy-0.11.0 -- /usr/local/psi4/psi4conda/bin/python
cachedir: .pytest_cache
rootdir: /usr/local/psi4
collecting ... zsh: segmentation fault  psi4 --test

Apologies that this is so long, does anyone have any idea what went wrong? Any help is appreciated, thanks.

EDIT:

Some extra (potentially useful?) information:

I ran zsh -i -x -c psi4 --test, and the result was, well, long. If someone wants the full version just ask, but here are the last few lines of the output:

+(eval):1> PS1='(base) %n@%m %1~ %# ' 
+(eval):2> export PATH=/usr/local/psi4/psi4conda/bin:/usr/local/orca/orca:/usr/local/psi4/psi4conda/bin:/usr/local/orca/orca:/usr/local/psi4/psi4conda/bin:/usr/local/psi4/psi4conda/condabin:/usr/local/psi4/psi4conda/bin:/usr/local/orca/orca:/usr/local/psi4/psi4conda/bin:/usr/local/orca/orca:/usr/local/orca/orca:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
+(eval):3> export CONDA_SHLVL=1
+(eval):4> export CONDA_PROMPT_MODIFIER='(base) '
+__conda_activate:16> __conda_hashr
+__conda_hashr:1> [ -n x ']'
+__conda_hashr:2> rehash
+/Users/wane/.zshrc:14> unset __conda_setup
+zsh:1> psi4
Traceback (most recent call last):
  File "/usr/local/psi4/psi4conda/bin/psi4", line 211, in <module>
    raise KeyError("The file %s does not exist." % args["input"])
KeyError: 'The file input.dat does not exist.'

(base) username@computername directory %. is conda’s way of telling which environment you have activated.

Does psi4 --version work?

There is the occasional problem, especially on osx, with a plugin that can cause a seg fault.

Go to this file:
/usr/local/psi4/psi4conda/lib/python3.7/site-packages/psi4/driver/endorsed_plugins.py (I guessed location from your path)

and comment out these four lines. It can segfault during the import

 try:
    import v2rdm_casscf
except ImportError:
    pass

Though I recommend to start using either the nightly/developer build or use the newly minted release candidate (Install v1.4.0rc1+ | Installs).
Now that you have miniconda installed you can run the nightly build alongside the 1.3.2 version like shown here:
Conda Binary Distribution

Thanks for the reply!

psi4 --version seems to work and output 1.3.2

I commented those lines but no luck, psi4 --test still give the same error.

Is v1.4.0rc1+ the new stable version? I might delete everything and start over with that one if 1.3.2 is already out of date.

No, it’s the first release candidate of v1.4, i.e. not yet the stable version.

You can keep your current miniconda installation and just make a new environment for a different psi4 version.

If you want to install cleanly again, you can also install miniconda separately and set it up however you want. The psi4 installer is just for convenience and those unfamiliar with the shell.


What is your osx version? Is this still an intel machine? No one tested psi4 on Apple Silicon yet.

It’s Big Sur 11.2.2, but still Intel i5.

I did what I could to remove the last versions of conda and psi4 I had: deleted the my psi4 directory as well as ~/.zshrc and the psi4 stuff in ~/.zprofile, and restarted the shell. Is there anywhere else I should check? If there is still some hanging around, it could have been where my problems came from.

I installed miniconda, and that seemed to go fine, but when I ran conda install psi4=1.4rc1 psi4-rt=1.4.dev30 python=3.9 -c psi4/label/dev , conda gave a lot of errors.

I’ve added the full out put as an attachment, but here are the highlights:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
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 a past
explicit spec that is not an explicit spec in this operation (python):

  - psi4-rt=1.4.dev30 -> fockci[version='>=0.2.0,<0.3.0a0'] -> python[version='>=2.7,<2.8.0a0|>=3.6|>=3.5,<3.6.0a0']
  - psi4-rt=1.4.dev30 -> python[version='>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']
  - psi4=1.4rc1 -> mkl-service[version='>=2,<3.0a0'] -> python[version='>=2.7,<2.8.0a0|>=3.6|>=3.5|>=3.5,<3.6.0a0|>=3.6.0']
  - psi4=1.4rc1 -> python[version='>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']
  - python=3.9

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

Output in format: Requested package -> Available versions

After that there are a lot of package conflicts, and:

% psi4 --test
zsh: command not found: psi4

psiinstalloutput.txt (42.4 KB)

I don’t really know anything about conda, any suggestions for how to fix this are welcome, thanks!

The simplest solution is to install Psi4 to a new conda environment. The point of creating a new environment is that different programs live in different environments. Their dependencies can’t interefere with each other, but the programs can’t interact with each other, either.

I recommend you create a new environment and install Psi4 there, per the instructions on the download side. If there’s some other program you need with Psi4, I can help, but it’s going to be more complicated.

Thanks for the reply, it looks like it’s working more or less now! It seems like v1.4 still has some bugs; hopefully this helps sort them out in the future.

After running conda create --name psi4env, and conda activate psi4env,
conda install psi4 psi4-rt python=3.9 -c psi4/label/dev still gave the same errors with not being able to resolve the environment and having a lot of incompatibilities.

When I tried to do conda install psi4 psi4-rt python=3.7 -c psi4 instead, it downloaded without any errors. psi4 --test gave a lot of warnings, but it didn’t seem like a problem.

I ran the line: conda update psi4 -c psi4/label/dev, and that also worked great and updated great, but now psi4 --test outputs a lot of errors:

../../../usr/local/psi4/conda/envs/psi4env/lib/python3.7/site-packages/psi4/tests/test_addons.py::test_v2rdm_casscf dyld: lazy symbol binding failed: Symbol not found: __ZN3psi7Options7get_strENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
  Referenced from: /usr/local/psi4/conda/envs/psi4env/lib/python3.7/site-packages/v2rdm_casscf/v2rdm_casscf.so
  Expected in: /usr/local/psi4/conda/envs/psi4env/lib//python3.7/site-packages/psi4/core.cpython-37m-darwin.so

dyld: Symbol not found: __ZN3psi7Options7get_strENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
  Referenced from: /usr/local/psi4/conda/envs/psi4env/lib/python3.7/site-packages/v2rdm_casscf/v2rdm_casscf.so
  Expected in: /usr/local/psi4/conda/envs/psi4env/lib//python3.7/site-packages/psi4/core.cpython-37m-darwin.so

Fatal Python error: Aborted

There was a little bit more after that but that was where it started.

I ran a test with H2O and it looks like it ran and exited fine, thanks for all the help you guys!

“Symbol not found” errors with V2RDM aren’t good, but that’s an error we can deal with. Glad to hear things are working. I’ll pass your report on to @loriab, who is in charge of our conda stack.