How to run psi4 on windows 10?

Hello,

I installed windows 10 conda version of psi4, but I am unable to execute it. How can I do that?

Thanks,

Sergio

The one-file installer or conda install? What does it do when you try to execute?

I installed by a one-file installer.

I executed:

D:\Programas\psi4conda\Scripts\psi4 --test
Traceback (most recent call last):
File “D:\Programas\psi4conda\lib\site-packages\psi4_init_.py”, line 55, in
from . import core
ImportError: DLL load failed while importing core: Não foi possível encontrar o módulo especificado.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Programas\psi4conda\Scripts\psi4-script.py”, line 184, in
import psi4
File “D:\Programas\psi4conda\lib\site-packages\psi4_init_.py”, line 60, in
raise ImportError("{0}".format(err))
ImportError: DLL load failed while importing core: The module is not found).

ok. any chance the OS is either never upgraded or very recently upgraded? what is the result of conda list? if there is such a thing on Windows, what’s which conda python psi4?

as you may have guessed, the psi devs don’t have much experience with Windows, so I’m seeking clues. the installer definitely worked in CI and for a tester, but I’d have to look up exactly what Windows versions those were.

Thanks. I solved the problem by using Anaconda prompt, that is installed psi4conda directory.

Oh great, thanks for letting us know. Would you describe what worked vs. what didn’t so we can guide others?

I have the same error message:
Microsoft Windows [Version 10.0.19042.1110]
(c) Microsoft Corporation. All rights reserved.

C:\Users\mende>psi4
Traceback (most recent call last):
File “C:\ProgramData\psi4conda\lib\site-packages\psi4_init_.py”, line 55, in
from . import core
ImportError: DLL load failed while importing core: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\ProgramData\psi4conda\Scripts\psi4-script.py”, line 182, in
import psi4 # isort:skip
File “C:\ProgramData\psi4conda\lib\site-packages\psi4_init_.py”, line 60, in
raise ImportError("{0}".format(err))
ImportError: DLL load failed while importing core: A dynamic link library (DLL) initialization routine failed.

C:\Users\mende>conda list
# packages in environment at C:\ProgramData\psi4conda:
#
# Name Version Build Channel
atomicwrites 1.4.0 pyh9f0ad1d_0 conda-forge
attrs 21.2.0 pyhd8ed1ab_0 conda-forge
brotlipy 0.7.0 py38h294d835_1001 conda-forge
ca-certificates 2021.5.30 h5b45459_0 conda-forge
certifi 2021.5.30 py38haa244fe_0 conda-forge
cffi 1.14.6 py38hd8c33c5_0 conda-forge
chardet 4.0.0 py38haa244fe_1 conda-forge
charset-normalizer 2.0.0 pyhd8ed1ab_0 conda-forge
colorama 0.4.4 pyh9f0ad1d_0 conda-forge
conda 4.10.3 py38haa244fe_0 conda-forge
conda-package-handling 1.7.3 py38h31c79cd_0 conda-forge
console_shortcut 0.1.1 4
cryptography 3.4.7 py38hd7da0ea_0 conda-forge
decorator 5.0.9 pyhd8ed1ab_0 conda-forge
dftd3 3.2.1 1 psi4
gau2grid 2.0.7 hcb41399_1 conda-forge
gcp 2.0.2 0 psi4
idna 3.1 pyhd3deb0d_0 conda-forge
importlib-metadata 4.6.3 py38haa244fe_0 conda-forge
importlib_metadata 4.6.3 hd8ed1ab_0 conda-forge
importlib_resources 5.2.2 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
intel-openmp 2019.1 144
libblas 3.8.0 8_mkl conda-forge
libcblas 3.8.0 8_mkl conda-forge
libint2 2.6.0 h2e52968_1 psi4
liblapack 3.8.0 8_mkl conda-forge
libxc 5.1.5 py38h294d835_1 conda-forge
menuinst 1.4.17 py38haa244fe_1 conda-forge
mkl 2019.1 144
more-itertools 8.8.0 pyhd8ed1ab_0 conda-forge
msgpack-python 1.0.2 py38hbd9d945_1 conda-forge
networkx 2.5 py_0 conda-forge
numpy 1.21.1 py38h09042cb_0 conda-forge
openssl 1.1.1k h8ffe710_0 conda-forge
packaging 21.0 pyhd8ed1ab_0 conda-forge
pint 0.17 pyhd8ed1ab_0 conda-forge
pip 21.2.2 pyhd8ed1ab_0 conda-forge
pluggy 0.13.1 py38haa244fe_4 conda-forge
psi4 1.4+9485035 py38_0 psi4
psutil 5.8.0 py38h294d835_1 conda-forge
py 1.10.0 pyhd3deb0d_0 conda-forge
py-cpuinfo 8.0.0 pyhd8ed1ab_0 conda-forge
pycosat 0.6.3 py38h294d835_1006 conda-forge
pycparser 2.20 pyh9f0ad1d_2 conda-forge
pydantic 1.8.2 py38h294d835_0 conda-forge
pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pysocks 1.7.1 py38haa244fe_3 conda-forge
pytest 6.2.4 py38haa244fe_0 conda-forge
python 3.8.10 h7840368_1_cpython conda-forge
python_abi 3.8 2_cp38 conda-forge
pywin32 300 py38h294d835_0 conda-forge
pyyaml 5.4.1 py38h294d835_0 conda-forge
qcelemental 0.21.0 pyhd8ed1ab_0 conda-forge
qcengine 0.19.0 pyhd8ed1ab_0 conda-forge
requests 2.26.0 pyhd8ed1ab_0 conda-forge
ruamel_yaml 0.15.80 py38h294d835_1004 conda-forge
setuptools 49.6.0 py38haa244fe_3 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sqlite 3.36.0 h8ffe710_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tqdm 4.62.0 pyhd8ed1ab_0 conda-forge
typing-extensions 3.10.0.0 hd8ed1ab_0 conda-forge
typing_extensions 3.10.0.0 pyha770c72_0 conda-forge
ucrt 10.0.20348.0 h57928b3_0 conda-forge
urllib3 1.26.6 pyhd8ed1ab_0 conda-forge
vc 14.2 hb210afc_5 conda-forge
vs2015_runtime 14.29.30037 h902a5da_5 conda-forge
wheel 0.36.2 pyhd3deb0d_0 conda-forge
win_inet_pton 1.1.0 py38haa244fe_2 conda-forge
wincertstore 0.2 py38haa244fe_1006 conda-forge
yaml 0.2.5 he774522_0 conda-forge
zipp 3.5.0 pyhd8ed1ab_0 conda-forge

C:\Users\mende>which conda python psi4
‘which’ is not recognized as an internal or external command,
operable program or batch file.

EDIT I’m not very computer savvy, I hope it isn’t something silly. I installed and uninstalled a few times trying to see if it would work. The installer was from this link: http://vergil.chemistry.gatech.edu/psicode-download/Psi4conda-1.4-py38-Windows-x86_64.exe
I installed most recently using the “for all users” option, and ticked “add psi4conda to my PATH environment variable”.

The equivalent of which on Windows is, where, I believe.

This is probably another time to ping @loriab.

Ok thanks.
Output is:
C:\Users\mende>where conda python psi4
C:\ProgramData\psi4conda\Library\bin\conda.bat
C:\ProgramData\psi4conda\Scripts\conda.exe
C:\ProgramData\psi4conda\python.exe
C:\Users\mende\AppData\Local\Microsoft\WindowsApps\python.exe
C:\ProgramData\psi4conda\Scripts\psi4.exe

C:\Users\mende>

I am also having the same issue as @Epiph on Windows 10.

I have installed Psi4 1.4 with these commands via the Anaconda prompt:

conda create psi4 python=3.8 -c psi4 -c conda-forge --name psi4-conda -y
conda activate psi4-conda
psi4 --version

And I get the error:

Traceback (most recent call last):
  File "C:\Users\nigel\.conda\envs\psi4-conda\lib\site-packages\psi4\__init__.py", line 55, in <module>
    from . import core
ImportError: DLL load failed while importing core: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\nigel\.conda\envs\psi4-conda\Scripts\psi4-script.py", line 182, in <module>
    import psi4  # isort:skip
  File "C:\Users\nigel\.conda\envs\psi4-conda\lib\site-packages\psi4\__init__.py", line 60, in <module>
    raise ImportError("{0}".format(err))
ImportError: DLL load failed while importing core: A dynamic link library (DLL) initialization routine failed.

This is on a machine with a “AMD Ryzen 9 3900X” processor. I have a VM with an “Intel Xeon Gold 5218” processor and that works as expected. @Epiph which processor do you have? I am wondering if the CPU instruction set could be the cause of this.

Intel(R) Pentium(R) CPU 4415U @ 2.30GHz 2.30 GHz
I’m on a laptop

I ran an installer rebuild, and, sure enough, it shows the DLL error: v1.4 installers, take 1 · psi4/psi4meta@b7f1dd0 · GitHub . This suggests that some change to the dependency packages or channels for Windows has occurred. So that would explain the conda create -n p4env psi4 ... problem.

I’m still surprised by the psi4conda installer (downloaded exe file) problem, though, as the dependency packages are baked into the exe and were a consistent and tested set at installer build time. Maybe try removing that AppData location from your path @Epiph. And you definitely haven’t executed further conda commands after the psi4conda install?

I received exactly the same error message. I removed the same AppData location from path that you referred. When i run where conda python psi4 in anaconda3 prompt it gives

 C:\Users\ataoz>where conda python psi4
D:\anaconda3\Library\bin\conda.bat
D:\anaconda3\Scripts\conda.exe
D:\anaconda3\condabin\conda.bat
D:\anaconda3\python.exe
D:\Python\Python37\python.exe
INFO: Could not find "psi4".

When I did it with psi4conda prompt, I received

 C:\Users\ataoz>where conda python psi4
D:\Users\ataoz\psi4conda\Library\bin\conda.bat
D:\Users\ataoz\psi4conda\Scripts\conda.exe
D:\Users\ataoz\psi4conda\condabin\conda.bat
D:\anaconda3\Library\bin\conda.bat
D:\anaconda3\Scripts\conda.exe
D:\Users\ataoz\psi4conda\python.exe
D:\anaconda3\python.exe
D:\Python\Python37\python.exe
D:\Users\ataoz\psi4conda\Scripts\psi4.exe

Anyway, anaconda3 prompt doesn’t even recognize psi4 command for psi4 --test. psi4conda prompt says

 C:\Users\ataoz>psi4 --test
Traceback (most recent call last):
  File "D:\Users\ataoz\psi4conda\lib\site-packages\psi4\__init__.py", line 55, in <module>
    from . import core
ImportError: DLL load failed while importing core: Devingen bağlantı kitaplığını (DLL) başlatma işlemi başarısız.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Users\ataoz\psi4conda\Scripts\psi4-script.py", line 182, in <module>
    import psi4  # isort:skip
  File "D:\Users\ataoz\psi4conda\lib\site-packages\psi4\__init__.py", line 60, in <module>
    raise ImportError("{0}".format(err))
ImportError: DLL load failed while importing core: Devingen bağlantı kitaplığını (DLL) başlatma işlemi başarısız.

I really don’t get about what the problem is. After any solution about this problem in advance, probably using psi4 with Spyder or VSCode will be a problem.

Same issue here…

"C:\psi4conda\Scripts>psi4
Traceback (most recent call last):
File “C:\psi4conda\lib\site-packages\psi4_init_.py”, line 55, in
from . import core
ImportError: DLL load failed while importing core: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\psi4conda\Scripts\psi4-script.py”, line 182, in
import psi4 # isort:skip
File “C:\psi4conda\lib\site-packages\psi4_init_.py”, line 60, in
raise ImportError("{0}".format(err))
ImportError: DLL load failed while importing core: The specified module could not be found.

C:\psi4conda\Scripts>"

I believe the “ImportError: DLL load failed while importing core: A dynamic link library (DLL) initialization routine failed.” error is caused by Psi4 being bulit with AVX512 instructions then being run on CPUs which do not support AVX512. Building Psi4 from source with the /arch:AVX fixes the issue.

Thanks for the /arch:AVX build info, @Nigel . The usual conda build for windows should have set AVX2, and @kcpearce reports the conda package to not work even for his AVX2-enabled machine. I’m trying a build now (https://github.com/psi4/psi4/pull/2292) that doesn’t set /arch, so we’ll see how that goes.

If this is an instruction set issue, maybe this explains why CI is so inconsistent in terms of testing the installers – different testing env on different runs.

ok, a win conda package built with just /arch:AVX is posted and installable via -c psi4/label/dev. It should have version psi4-1.5a1.dev46 in conda list. glad to hear reports of success or continued failure.

Install of psi4 using

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

into a fresh environment worked.

I also had dll error as above when installing conda package as per Install v1.4+ | Installs

(Running Windows 10 on Intel Coffee Lake CPU)

Install of psi4 using conda install -c conda-forge -c psi4/label/dev psi4 into a fresh environment worked.

Hmm, that’s peculiar but not implausible. Could you run conda list on the c-f env, please? I’d like to check if the psi4 was dev46 or an earlier one to see how many variables are changing at once.