How to run psi4 on windows 10?

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.

So straight install with

conda install -c psi4/label/dev psi4

gives:

conda install -c psi4/label/dev psi4
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:

in successful conda-forge environment psi4 version is:

psi4 1.5a1.dev46+e52a595 py38_0 psi4/label/dev

I’ve added a few bits to the environment now, but I can run another if you want the full conda list

I can confirm this: an install conda create -n test psi4=1.5a1.dev46 -c psi4/label/dev -c psi4 fails to find libxc and gau2grid. With -c conda-forge it works.

Ok, yes, I was addled in my last post. The official base for Psi4 with windows is c-f, whereas for linux and mac it’s defaults. Even says so here: Install v1.4+ | Installs (windows/conda settings).

So the real question is – holding c-f constant – does pre-dev46 not work and dev46 work? I think what @brian and @tetrahydrofuran have been posting is consistent with that, so let me know if there’s any evidence to the contrary.

This section of the manual works very well. I can run psi4 --test without the error I mentioned before in this topic. However, now there is a problem about path. When I use psi4 as python module on Spyder, it gives ModuleNotFoundError: No module named 'psi4' . I checked the path, it gives the true directory. Any idea?

@loriab Just to close one issue off, I can confirm fresh install of psi4 1.4 using:

conda install psi4 python=3.8 -c psi4 -c conda-forge

gives:

>>> import psi4
Traceback (most recent call last):
  File "C:\Users\*****\.conda\envs\test_stable\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 "<stdin>", line 1, in <module>
  File "C:\Users\*****\.conda\envs\test_stable\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.

install of psi4=1.5a1.dev46 using:

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

works without issue.

Couple of differences between conda-forge environments:

Psi4 1.4 										Dev46

pydantic	1.3	py38hfa6e2cd_0	psi4    -->   	pydantic	1.8.2	py38h294d835_0	conda-forge
qcelemental	0.17.0	py_0	psi4		--> 	qcelemental	0.22.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

@brian conda install -c conda-forge -c psi4/label/dev psi4 works well in my computer either. Has any problem about running psi4 occurred so far? When I try to use it as a python module, it cannot be imported.

1 Like

@oddyses3 Assume you are installing in Anaconda prompt? And from your post above, I assume psi4 --test runs without errors?

Activate the Conda environment where Psi4 was installed, type python to start interactive python mode. Then import psi4. Does that work?

after installation, I ran file and found following error. Any possible solution?
Traceback (most recent call last):
File “C:\ProgramData\psi4conda\Scripts\psi4-script.py”, line 216, in
raise KeyError(“The file %s does not exist.” % args[“input”])
KeyError: ‘The file - does not exist.’

I only get this error when I run psi4 -. You might have accidentally added an extra space to a flag (e.g. psi4 - h instead of psi4 -h).

@brian Yeah, it finally works. I tried it on Spyder IDE by the time I saw your response. Running it on conda prompt works very well. Thanks!

conda install psi4 python=3.8 -c psi4 -c conda-forge

In other words, use the instructions we have on the download page. Topic closed.