AdvancedPhotonSource / GSAS-II

Home for GSAS-II: crystallographic and diffraction-based structural characterization of materials
Other
34 stars 14 forks source link

Conda installation issue on Mac OS Sonoma #65

Closed dragonyanglong closed 1 month ago

dragonyanglong commented 2 months ago

Dear @briantoby , I was following the instructions on https://advancedphotonsource.github.io/GSAS-II-tutorials/install.html#gsas2pkg-conda-package, but failed. Thanks for your help.

After installing

conda create -n GSASII briantoby::gsas2pkg  -c conda-forge
conda activate GSASII

I list my conda environment below

(GSASII) longyang@Longs-MacBook-Pro GSASII % conda list
# packages in environment at /Users/longyang/opt/anaconda3/envs/GSASII:
#
# Name                    Version                   Build  Channel
apr                       1.7.0                hf5a09cc_6    conda-forge
archspec                  0.2.3              pyhd8ed1ab_0    conda-forge
boltons                   24.0.0             pyhd8ed1ab_0    conda-forge
brotli                    1.1.0                h00291cd_2    conda-forge
brotli-bin                1.1.0                h00291cd_2    conda-forge
brotli-python             1.1.0           py312h5861a67_2    conda-forge
bzip2                     1.0.8                hfdf4475_7    conda-forge
c-ares                    1.33.1               h44e7173_0    conda-forge
ca-certificates           2024.8.30            h8857fd0_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
certifi                   2024.8.30          pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py312hf857d28_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     24.7.1          py312hb401068_0    conda-forge
conda-libmamba-solver     24.7.0             pyhd8ed1ab_0    conda-forge
conda-package-handling    2.3.0              pyh7900ff3_0    conda-forge
conda-package-streaming   0.10.0             pyhd8ed1ab_0    conda-forge
contourpy                 1.3.0           py312hc5c4d5f_1    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
distro                    1.9.0              pyhd8ed1ab_0    conda-forge
expat                     2.6.3                hac325c4_0    conda-forge
fmt                       10.2.1               h7728843_0    conda-forge
fonttools                 4.53.1          py312hb553811_1    conda-forge
freetype                  2.12.1               h60636b9_2    conda-forge
frozendict                2.4.4           py312hbd25219_0    conda-forge
gettext                   0.22.5               hdfe23c8_3    conda-forge
gettext-tools             0.22.5               hdfe23c8_3    conda-forge
gsas2pkg                  2.2.0                         0    briantoby
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
h5py                      3.11.0          nompi_py312hfc94b03_102    conda-forge
hdf5                      1.14.3          nompi_h687a608_105    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       75.1                 h120a0e1_0    conda-forge
idna                      3.8                pyhd8ed1ab_0    conda-forge
imageio                   2.35.1             pyh12aca89_0    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               3.0.0           py312hb401068_1    conda-forge
kiwisolver                1.4.7           py312hc5c4d5f_0    conda-forge
krb5                      1.21.3               h37d8d59_0    conda-forge
lcms2                     2.16                 ha2f27b4_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libaec                    1.1.3                h73e2aa4_0    conda-forge
libapr                    1.7.0                hf5a09cc_6    conda-forge
libapriconv               1.2.2                hf5a09cc_6    conda-forge
libaprutil                1.6.1                hf71c377_6    conda-forge
libarchive                3.7.4                h20e244c_0    conda-forge
libasprintf               0.22.5               hdfe23c8_3    conda-forge
libasprintf-devel         0.22.5               hdfe23c8_3    conda-forge
libblas                   3.9.0           22_osx64_openblas    conda-forge
libbrotlicommon           1.1.0                h00291cd_2    conda-forge
libbrotlidec              1.1.0                h00291cd_2    conda-forge
libbrotlienc              1.1.0                h00291cd_2    conda-forge
libcblas                  3.9.0           22_osx64_openblas    conda-forge
libcurl                   8.10.0               h58e7537_0    conda-forge
libcxx                    18.1.8               hd876a4e_7    conda-forge
libdeflate                1.21                 hfdf4475_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 h10d778d_2    conda-forge
libexpat                  2.6.3                hac325c4_0    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgettextpo              0.22.5               hdfe23c8_3    conda-forge
libgettextpo-devel        0.22.5               hdfe23c8_3    conda-forge
libgfortran               5.0.0           13_2_0_h97931a8_3    conda-forge
libgfortran5              13.2.0               h2873a65_3    conda-forge
libiconv                  1.17                 hd75f5a5_2    conda-forge
libintl                   0.22.5               hdfe23c8_3    conda-forge
libintl-devel             0.22.5               hdfe23c8_3    conda-forge
libjpeg-turbo             3.0.0                h0dc2134_1    conda-forge
liblapack                 3.9.0           22_osx64_openblas    conda-forge
libmamba                  1.5.9                hd44d3b3_0    conda-forge
libmambapy                1.5.9           py312haab923c_0    conda-forge
libnghttp2                1.58.0               h64cf6d3_1    conda-forge
libopenblas               0.3.27          openmp_h8869122_1    conda-forge
libpng                    1.6.43               h92b6c6a_0    conda-forge
libsolv                   0.7.30               h69d5d9b_0    conda-forge
libsqlite                 3.46.1               h4b8f8c9_0    conda-forge
libssh2                   1.11.0               hd019ec5_0    conda-forge
libtiff                   4.6.0                h603087a_4    conda-forge
libwebp-base              1.4.0                h10d778d_0    conda-forge
libxcb                    1.16                 h00291cd_1    conda-forge
libxml2                   2.12.7               heaf3512_4    conda-forge
libzlib                   1.3.1                h87427d6_1    conda-forge
llvm-openmp               18.1.8               h15ab845_1    conda-forge
lz4-c                     1.9.4                hf0c8a7f_0    conda-forge
lzo                       2.10              h10d778d_1001    conda-forge
matplotlib                3.9.2           py312hb401068_1    conda-forge
matplotlib-base           3.9.2           py312h30cc4df_1    conda-forge
menuinst                  2.1.2           py312hb401068_1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
ncurses                   6.5                  hf036a51_1    conda-forge
numpy                     2.1.1           py312he4d506f_0    conda-forge
openjpeg                  2.5.2                h7310d3a_0    conda-forge
openssl                   3.3.2                hd23fc13_0    conda-forge
packaging                 24.1               pyhd8ed1ab_0    conda-forge
pathlib2                  2.3.7.post1     py312hb401068_4    conda-forge
pcre2                     10.43                h0ad2156_0    conda-forge
pillow                    10.4.0          py312h683ea77_1    conda-forge
pip                       24.2               pyh8b19718_1    conda-forge
platformdirs              4.3.2              pyhd8ed1ab_0    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               hc929b4f_1001    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.6           py312h104f124_0    conda-forge
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pyopengl                  3.1.6              pyhd8ed1ab_1    conda-forge
pyparsing                 3.1.4              pyhd8ed1ab_0    conda-forge
pypubsub                  4.0.3                      py_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.12.5          h37a9e06_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python.app                1.4             py312h104f124_3    conda-forge
python_abi                3.12                    5_cp312    conda-forge
qhull                     2020.2               h3c5361c_5    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
reproc                    14.2.4.post0         h10d778d_1    conda-forge
reproc-cpp                14.2.4.post0         h93d8f39_1    conda-forge
requests                  2.32.3             pyhd8ed1ab_0    conda-forge
ruamel.yaml               0.18.6          py312h41838bb_0    conda-forge
ruamel.yaml.clib          0.2.8           py312h41838bb_0    conda-forge
scipy                     1.14.1          py312he82a568_0    conda-forge
serf                      1.3.8                         1
setuptools                73.0.1             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.46.1               he26b093_0    conda-forge
svn                       1.9.4                         0
tk                        8.6.13               h1abcd95_1    conda-forge
tornado                   6.4.1           py312hb553811_1    conda-forge
tqdm                      4.66.5             pyhd8ed1ab_0    conda-forge
truststore                0.9.2              pyhd8ed1ab_0    conda-forge
tzdata                    2024a                h8827d51_1    conda-forge
urllib3                   2.2.2              pyhd8ed1ab_1    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
wxpython                  4.2.1           py312hba984fc_5    conda-forge
xorg-libxau               1.0.11               h0dc2134_0    conda-forge
xorg-libxdmcp             1.1.3                h35c211d_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
yaml-cpp                  0.8.0                he965462_0    conda-forge
zlib                      1.3.1                h87427d6_1    conda-forge
zstandard                 0.23.0          py312h7122b0e_1    conda-forge
zstd                      1.5.6                h915ae27_0    conda-forge
dragonyanglong commented 2 months ago

BTW, I suspect the error is due to python version. From the web instruction, python 3.11 seems to be working. Then I tried to create a new environment as follows, but still no luck.

conda create -n GSASIItest
conda activate GSASIItest
conda install python=3.11 briantoby::gsas2pkg

It gave the error

(GSASII) longyang@Longs-MacBook-Pro GSASII % conda install python=3.11 briantoby::gsas2pkg
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 each other:

Output in format: Requested package -> Available versions

Package python conflicts for:
briantoby::gsas2pkg -> conda -> python[version='2.6.*|2.7.*|3.4.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.12,<3.13.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0|>=3.4,<3.5.0a0|3.3.*|>=3.5|>=3.4|>=3|>=3.6']
briantoby::gsas2pkg -> python[version='3.11.*|>=3.7']
python=3.11
briantoby commented 2 months ago

conda create -n GSASII briantoby::gsas2pkg -c conda-forge conda activate GSASII

This should force an installation of python 3.11, but clearly Python 3.12 was installed. I don't know why. Someday 3.12 should also work, but for now we are not able to build binaries for anything newer than 3.11. You are welcome to play around with the new build process that is currently a pull request, but I am going to put that off myself for a while.

  • I tried typing gsasII.sh, but showed zsh: command not found: gsasII.sh.

This would require a full path to the gsasII.sh file.

  • I tried typing pythonw /Users/longyang/opt/anaconda3/envs/GSASII/GSASII/GSASII.py, but gave the following error

Python/module versions loaded: Python: 3.12.5 from /Users/longyang/opt/anaconda3/envs/GSASII/bin/python. New untested version; please keep us posted

You should not need pythonw for GSAS-II anymore, but it should not hurt.

I list my conda environment below


(GSASII) longyang@Longs-MacBook-Pro GSASII % conda list
# packages in environment at /Users/longyang/opt/anaconda3/envs/GSASII:
#
# Name                    Version                   Build  Channel
numpy                     2.1.1           py312he4d506f_0    conda-forge
python                    3.12.5          h37a9e06_0_cpython    conda-forge

The binaries we supply require Python 3.11. and numpy 1.26.

briantoby commented 2 months ago

BTW, I suspect the error is due to python version.

I think you may well be correct.

> conda create -n GSASIItest
> conda activate GSASIItest
> conda install python=3.11 briantoby::gsas2pkg
> 
> 
> It gave the error
> 
> 
> (GSASII) longyang@Longs-MacBook-Pro GSASII % conda install python=3.11 briantoby::gsas2pkg
...
> UnsatisfiableError: The following specifications were found to be incompatible with each other:
> 
> Output in format: Requested package -> Available versions
> 
> Package python conflicts for:
> briantoby::gsas2pkg -> conda -> python[version='2.6.*|2.7.*|3.4.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.12,<3.13.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0|>=3.4,<3.5.0a0|3.3.*|>=3.5|>=3.4|>=3|>=3.6']
> briantoby::gsas2pkg -> python[version='3.11.*|>=3.7']
> python=3.11

I have to be honest that while I don't understand this error message, as it seems to imply that Python 3.11 would satisfy the requirements, I have a guess as to what the problem you are having here. I think you have installed anaconda's conda while I have been using the conda-forge version for all my recent work. The two should be compatible, but it may well be that without the -c conda-forge on the command line, only the anaconda locations are searched and it may not find the packages that GSAS-II needs.

I will need to try some testing to see if anaconda's miniconda will work as well as the miniforge from conda-forge. Until I do, I recommend using this command for the install:

  conda create -n GSASIItest python=3.11 numpy=1.26 briantoby::gsas2pkg -c conda-forge
  conda activate GSASIItest

You will need to remove the old GSASIItest with this command: conda env remove -n GSASIItest before running the new test. Please make note of the conda output when this runs as it will tell you where each package is downloaded from. That may well matter.

run GSAS-II with

  python ~/opt/anaconda3/envs/GSASIItest/GSASII/GSASII.py
briantoby commented 2 months ago

As a follow-up, I tried downloading the Anaconda Miniconda installer (rather than miniforge or mambaforge which I normally use). It worked fine too. After the install, I used the commands in the instructions (same as you list above):

  conda create -n GSASII briantoby::gsas2pkg  -c conda-forge
  conda activate GSASII

After those commands, the intended versions of Python (3.11.10) & numpy (1.26.4) were downloaded, not the ones you have listed above. After doing the activate command, the gsasII.sh was found in the path and a finder window was opened showing the GSAS-II Mac application:

image

I can see that somehow you obtained newer Python and numpy versions than required by the meta.yaml for the package. I'm really at a loss for how that happened, unless somehow local conda settings are somehow overriding my package's settings.

I'd be happy to meet with you over zoom/teams to see more on what you are doing.

dragonyanglong commented 2 months ago

Dear @briantoby , Thanks for your detailed reply.

I am using anaconda's conda. I tried again

 conda create -n GSASII briantoby::gsas2pkg  -c conda-forge
 conda activate GSASII

but still no luck. It still installed python 3.12.

I tried

  conda create -n GSASIItest python=3.11 numpy=1.26 briantoby::gsas2pkg -c conda-forge
  conda activate GSASIItest
  python ~/opt/anaconda3/envs/GSASIItest/GSASII/GSASII.py

It seems to work. Though the binary file seems like not installed. It pop out a window to ask download the binary file from github releases. After click download, the GSASII window appears.

A quick zoom meeting would be appreciated to go through what is going on here. What is your email? We can discuss the time to meet over the email.

briantoby commented 2 months ago

Hmmm, I don't understand this, but conda is pretty complex. What happens if you install a fresh copy of miniconda, say in /tmp/ and activate that? Perhaps then the

   conda create -n GSASII briantoby::gsas2pkg  -c conda-forge

command will work.

e-mail: toby at anl dot gov

dragonyanglong commented 2 months ago

Thanks. Email sent.

briantoby commented 1 month ago

The problem here seems to be that unless the version of gsas2pkg was specified, an older version would be used. Conda would rather use an older gsas2pkg with the latest Python than the newest gsas2pkg and downdate Python. The older gsas2pkg did not actually work with Py>3.11 so the older gsas2pkg files should not have allowed that. In any case, I don't want anyone to use the older gsas2pkg versions, as they require the subversion server or were test versions.

Removed all but the current gsas2pkg from the briantoby channel on conda-forge. That seems to fix this.