psi4 / psi4numpy

Combining Psi4 and Numpy for education and development.
BSD 3-Clause "New" or "Revised" License
330 stars 151 forks source link

conda install failed on windows #135

Closed m3lab-zzl closed 11 months ago

m3lab-zzl commented 11 months ago

Create new env and install psi4 failed without useful error message:

$ conda create -n p4env psi4 -c psi4 -y
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying 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:

I noticed in the anaconda repo, there is a win-64/psi4-1.7+6ce35a5-py38_0.tar.bz2, thus I assumed it was due to my newer python interpreter in the (base) env.

However, explicitly specify python=3.8 failed again, which is quite confusing:

$ conda create -n p4env python=3.8 psi4 -c psi4 -y
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying 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:

Output in format: Requested package -> Available versions

Package python conflicts for:
python=3.8
psi4 -> msgpack-python -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0|>=3.8|>=3.7|>=3.6|>=3.5|>=3.6.0']
psi4 -> python=3.8

Finally, create the env first, and install python=3.8, then psi4, failed again:

$ conda create -n p4env -y
$ conda activate p4env
$ conda install python=3.8 -y
$ conda install psi4 -c psi4
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using 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 each other:

Output in format: Requested package -> Available versions

FYI, I downloaded the tar.bz2 file, and this is the recipe/meta.yaml content:

# This file created by conda-build 3.23.2
# meta.yaml template originally from:
# D:\a\1\s\conda\win, last modified Tue Dec  6 22:14:44 2022
# ------------------------------------------------

package:
  name: psi4
  version: 1.7+6ce35a5
source:
  path: D:\a\1\s
build:
  script:
    - md C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Scripts
    - copy /y D:\a\1\b\install\bin\psi4 C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Scripts
    - echo __pycache__ > exclude.txt
    - xcopy /f /i /s /exclude:exclude.txt D:\a\1\b\install\lib\psi4 C:\\tools\\miniconda3\\conda-bld\\psi4_1670369969426\\_h_env\\Lib\\site-packages\psi4
    - xcopy /f /i /s D:\a\1\b\install\share\psi4\basis       C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Lib\share\psi4\basis
    - xcopy /f /i /s D:\a\1\b\install\share\psi4\plugin      C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Lib\share\psi4\plugin
    - xcopy /f /i /s D:\a\1\b\install\share\psi4\quadratures C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Lib\share\psi4\quadratures
    - xcopy /f /i /s D:\a\1\b\install\share\psi4\databases   C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Lib\share\psi4\databases
    - xcopy /f /i /s D:\a\1\b\install\share\psi4\fsapt       C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Lib\share\psi4\fsapt
    - xcopy /f /i /s D:\a\1\b\install\share\psi4\grids       C:\tools\miniconda3\conda-bld\psi4_1670369969426\_h_env\Lib\share\psi4\grids
  string: py38_0
requirements:
  build: []
  run:
    - dftd3-python
    - gau2grid
    - gcp-correction
    - intel-openmp=2019.1
    - libint2 2.6.0 h2e52968_4
    - libxc
    - mkl=2019.1
    - msgpack-python
    - networkx
    - numpy
    - optking
    - pytest>=7.0.1
    - python=3.8
    - qcelemental=0.25.1
    - qcengine=0.26.0
    - scipy
test:
  commands:
    - python -c "import psi4; assert psi4.test('quick') == 0"
    - psi4 --test quick
about: {}
extra:
  copy_test_source_files: true
  final: true

As you can see, it explicitly requires python=3.8, but I just keep failing install psi4 using conda (Even though I reinstall anaconda entirely). The only way left for me to use psi4 on Windows is to download psi4conda installer, after installing, I can activate it by passing the absolute path of psi4conda env.

$ conda env activate E:\Soft\psi4conda
loriab commented 11 months ago

please try conda install psi4 python=3.8 -c conda-forge/label/libint_dev -c conda-forge from https://psicode.org/installs/v18/ with windows/conda/*/stable choices.

m3lab-zzl commented 11 months ago

please try conda install psi4 python=3.8 -c conda-forge/label/libint_dev -c conda-forge from https://psicode.org/installs/v18/ with windows/conda/*/stable choices.

Thank you, @loriab, it works!

For guys who may run into this trouble in the future, please note that you should probably remove the mirror settings in .condarc, otherwise it may raise:

UnavailableInvalidChannel: HTTP 404 NOT FOUND for channel conda-forge/label/libint_dev <https://mirrors.somewhere/anaconda/cloud/conda-forge/label/libint_dev>

Cheers 🍻