joezuntz / cosmosis

Other
22 stars 16 forks source link

Error installing Cosmosis locally #120

Closed simran2296 closed 6 months ago

simran2296 commented 6 months ago

I am trying to install Cosmosis locally using mamba instructions here

I get following:

mamba install -y cosmosis cosmosis-build-standard-library

Looking for: ['cosmosis', 'cosmosis-build-standard-library']

pkgs/r/noarch No change pkgs/r/osx-arm64 No change pkgs/main/osx-arm64 No change pkgs/main/noarch No change

Pinned packages:

Could not solve for environment specs The following packages are incompatible ├─ cosmosis does not exist (perhaps a typo or a missing channel); └─ cosmosis-build-standard-library does not exist (perhaps a typo or a missing channel).

marcpaterno commented 6 months ago

The installation of cosmosis-build-standard-library depends on the tensorflow package, because of baccoemu. Unfortunately, tensorflow does not yet work with Python 3.12 (there is a long discussion on the tensorflow github site about getting it to work).

One thing that should work is to install cosmosis and cosmosis-build-standard-library into a new environment; that should then pick up Python 3.11, and the installation should then complete.

Another option is to downgrade the version of Python in your current environment to Python 3.11 with: mamba install python==3.11, and then to install cosmosis and cosmosis-build-standard-library. But the developers of Mamba and Conda generally recommend using different environments for different projects, just to avoid this kind of problem.

simran2296 commented 6 months ago

For the first option, I am trying to install it in a new environment and still get the same error message. For the second option, My current Python version is already 3.11.

marcpaterno commented 6 months ago

Can you please post the full command and output you get from the second option (creating a new environment)?

simran2296 commented 6 months ago

Here are the outputs:

(base) simran@simrans-Air ~ % conda env remove -p gw
(base) simran@simrans-Air ~ % python3 --version
Python 3.11.7 (base) simran@simrans-Air ~ % conda create -n gw -c conda-forge mamba

Retrieving notices: ...working... done WARNING: A conda environment already exists at '/Users/simran/anaconda3/envs/gw' Remove existing environment (y/[n])? y

Collecting package metadata (current_repodata.json): done Solving environment: done

==> WARNING: A newer version of conda exists. <== current version: 23.7.4 latest version: 24.1.1

Please update conda by running

$ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

 conda install conda=24.1.1

Package Plan

environment location: /Users/simran/anaconda3/envs/gw

added / updated specs:

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
python-3.12.2              |hdf0ec26_0_cpython        12.5 MB  conda-forge
------------------------------------------------------------
                                       Total:        12.5 MB

The following NEW packages will be INSTALLED:

archspec conda-forge/noarch::archspec-0.2.2-pyhd8ed1ab_0 boltons conda-forge/noarch::boltons-23.1.1-pyhd8ed1ab_0 brotli-python conda-forge/osx-arm64::brotli-python-1.1.0-py312h9f69965_1 bzip2 conda-forge/osx-arm64::bzip2-1.0.8-h93a5062_5 c-ares conda-forge/osx-arm64::c-ares-1.26.0-h93a5062_0 ca-certificates conda-forge/osx-arm64::ca-certificates-2024.2.2-hf0a4a13_0 certifi conda-forge/noarch::certifi-2024.2.2-pyhd8ed1ab_0 cffi conda-forge/osx-arm64::cffi-1.16.0-py312h8e38eb3_0 charset-normalizer conda-forge/noarch::charset-normalizer-3.3.2-pyhd8ed1ab_0 colorama conda-forge/noarch::colorama-0.4.6-pyhd8ed1ab_0 conda conda-forge/osx-arm64::conda-23.11.0-py312h81bd7bf_1 conda-libmamba-so~ conda-forge/noarch::conda-libmamba-solver-24.1.0-pyhd8ed1ab_0 conda-package-han~ conda-forge/noarch::conda-package-handling-2.2.0-pyh38be061_0 conda-package-str~ conda-forge/noarch::conda-package-streaming-0.9.0-pyhd8ed1ab_0 distro conda-forge/noarch::distro-1.9.0-pyhd8ed1ab_0 fmt conda-forge/osx-arm64::fmt-10.2.1-h2ffa867_0 icu conda-forge/osx-arm64::icu-73.2-hc8870d7_0 idna conda-forge/noarch::idna-3.6-pyhd8ed1ab_0 jsonpatch conda-forge/noarch::jsonpatch-1.33-pyhd8ed1ab_0 jsonpointer conda-forge/osx-arm64::jsonpointer-2.4-py312h81bd7bf_3 krb5 conda-forge/osx-arm64::krb5-1.21.2-h92f50d5_0 libarchive conda-forge/osx-arm64::libarchive-3.7.2-hcacb583_1 libcurl conda-forge/osx-arm64::libcurl-8.5.0-h2d989ff_0 libcxx conda-forge/osx-arm64::libcxx-16.0.6-h4653b0c_0 libedit conda-forge/osx-arm64::libedit-3.1.20191231-hc8eb9b7_2 libev conda-forge/osx-arm64::libev-4.33-h93a5062_2 libexpat conda-forge/osx-arm64::libexpat-2.5.0-hb7217d7_1 libffi conda-forge/osx-arm64::libffi-3.4.2-h3422bc3_5 libiconv conda-forge/osx-arm64::libiconv-1.17-h0d3ecfb_2 libmamba conda-forge/osx-arm64::libmamba-1.5.6-h90c426b_0 libmambapy conda-forge/osx-arm64::libmambapy-1.5.6-py312h344e357_0 libnghttp2 conda-forge/osx-arm64::libnghttp2-1.58.0-ha4dd798_1 libsolv conda-forge/osx-arm64::libsolv-0.7.28-h1059232_0 libsqlite conda-forge/osx-arm64::libsqlite-3.45.1-h091b4b1_0 libssh2 conda-forge/osx-arm64::libssh2-1.11.0-h7a5bd25_0 libxml2 conda-forge/osx-arm64::libxml2-2.12.5-h0d0cfa8_0 libzlib conda-forge/osx-arm64::libzlib-1.2.13-h53f4e23_5 lz4-c conda-forge/osx-arm64::lz4-c-1.9.4-hb7217d7_0 lzo conda-forge/osx-arm64::lzo-2.10-h642e427_1000 mamba conda-forge/osx-arm64::mamba-1.5.6-py312h14bc7db_0 menuinst conda-forge/osx-arm64::menuinst-2.0.2-py312h81bd7bf_0 ncurses conda-forge/osx-arm64::ncurses-6.4-h463b476_2 openssl conda-forge/osx-arm64::openssl-3.2.1-h0d3ecfb_0 packaging conda-forge/noarch::packaging-23.2-pyhd8ed1ab_0 pip conda-forge/noarch::pip-24.0-pyhd8ed1ab_0 platformdirs conda-forge/noarch::platformdirs-4.2.0-pyhd8ed1ab_0 pluggy conda-forge/noarch::pluggy-1.4.0-pyhd8ed1ab_0 pybind11-abi conda-forge/noarch::pybind11-abi-4-hd8ed1ab_3 pycosat conda-forge/osx-arm64::pycosat-0.6.6-py312h02f2b3b_0 pycparser conda-forge/noarch::pycparser-2.21-pyhd8ed1ab_0 pysocks conda-forge/noarch::pysocks-1.7.1-pyha2e5f31_6 python conda-forge/osx-arm64::python-3.12.2-hdf0ec26_0_cpython python_abi conda-forge/osx-arm64::python_abi-3.12-4_cp312 readline conda-forge/osx-arm64::readline-8.2-h92ec313_1 reproc conda-forge/osx-arm64::reproc-14.2.4.post0-h93a5062_1 reproc-cpp conda-forge/osx-arm64::reproc-cpp-14.2.4.post0-h965bd2d_1 requests conda-forge/noarch::requests-2.31.0-pyhd8ed1ab_0 ruamel.yaml conda-forge/osx-arm64::ruamel.yaml-0.18.6-py312he37b823_0 ruamel.yaml.clib conda-forge/osx-arm64::ruamel.yaml.clib-0.2.8-py312he37b823_0 setuptools conda-forge/noarch::setuptools-69.0.3-pyhd8ed1ab_0 tk conda-forge/osx-arm64::tk-8.6.13-h5083fa2_1 tqdm conda-forge/noarch::tqdm-4.66.2-pyhd8ed1ab_0 truststore conda-forge/noarch::truststore-0.8.0-pyhd8ed1ab_0 tzdata conda-forge/noarch::tzdata-2024a-h0c530f3_0 urllib3 conda-forge/noarch::urllib3-2.2.0-pyhd8ed1ab_0 wheel conda-forge/noarch::wheel-0.42.0-pyhd8ed1ab_0 xz conda-forge/osx-arm64::xz-5.2.6-h57fd34a_0 yaml-cpp conda-forge/osx-arm64::yaml-cpp-0.8.0-h13dd4ca_0 zstandard conda-forge/osx-arm64::zstandard-0.22.0-py312h7975427_0 zstd conda-forge/osx-arm64::zstd-1.5.5-h4f39d0f_0

Proceed ([y]/n)? y

Downloading and Extracting Packages

Preparing transaction: done Verifying transaction: done Executing transaction: done #

To activate this environment, use

#

$ conda activate gw

#

To deactivate an active environment, use

#

$ conda deactivate

(base) simran@simrans-Air ~ % conda activate gw (gw) simran@simrans-Air ~ % mamba install -y cosmosis cosmosis-build-standard-library

Looking for: ['cosmosis', 'cosmosis-build-standard-library']

pkgs/main/osx-arm64 (check zst) Checked 0.2s pkgs/main/noarch (check zst) Checked 0.1s pkgs/r/osx-arm64 (check zst) Checked 0.0s pkgs/r/noarch (check zst) Checked 0.1s pkgs/r/osx-arm64 108.0 B @ 566.0 B/s 0.2s pkgs/main/noarch 702.8kB @ 1.5MB/s 0.5s pkgs/main/osx-arm64 2.1MB @ 3.0MB/s 0.7s pkgs/r/noarch 2.1MB @ 2.5MB/s 0.8s

Pinned packages:

Could not solve for environment specs The following packages are incompatible ├─ cosmosis does not exist (perhaps a typo or a missing channel); └─ cosmosis-build-standard-library does not exist (perhaps a typo or a missing channel). (gw) simran@simrans-Air ~ % python3 --version
Python 3.11.7 (gw) simran@simrans-Air ~ %

marcpaterno commented 6 months ago

Near the beginning is the indicator of the issue: the output from your conda create -n gw -c conda-forge mamba shows that conda will install python 3.12.2. The problem is that when you create the environment, the only package you are installing is mamba. When you later try to install cosmosis and cosmosis-build-standard-library into this environment, it fails because the environment already contains Python 3.12.2.

Please try instead (you'll have to either remove the gw environment, or choose a different name for the new enviroment),

conda create -n gw cosmosis cosmosis-build-standard-library

This should create an environment named gw that contains both of them, and which contains python 3.11.x.