понеделник, 12 септември 2022 г.

How to install polychord with conda

 That was a long battle, but it seems now all is fine. I'm using Manjaro, since Sabayon has no longer installation images with new kernels and Mocaccino is still not ready. But it seems Arch and Gentoo are not sooo different. Anyway, back to python. So this was an epic fight including downgrading binutils (of course) and installing pretty much any gfortran package out there. Here's some of what I did:

conda create --name MyEnv
conda activate MyEnv
conda install -n MyEnv pip
cd anaconda3/bin
source activate MyEnv
pip install https://github.com/PolyChord/PolyChordLite/archive/master.zip
conda install -c anaconda ipykernel
python3 -m ipykernel install --user --name=MyEnv
pip install emcee
pip install pil
pip install matplotlib
pip install arviz
pip install getdist

Alternative installation without conda:

pip install notebook

#jupyter notebook #to start it

conda deactivate

conda config --set auto_activate_base false #to deactivate conda permanently

pip install https://github.com/PolyChord/PolyChordLite/archive/master.zip

pip install build (or anything that is missing)

also don't forget to install gcc and gcc++ as they are critical for the successful installation. 

 

Below is what is currently installed in this conda env. I have no idea what I have in the base conda and in pip in general as I pretty much installed anything:

conda list --explicit
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
https://conda.anaconda.org/anaconda/linux-64/ca-certificates-2020.10.14-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.35.1-hea4e1c9_2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-9.3.0-h6de172a_19.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/tzdata-2021a-he74cb21_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libgomp-9.3.0-h2828fa1_19.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-1_gnu.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-9.3.0-h2828fa1_19.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libffi-3.3-h58526e2_2.tar.bz2
https://conda.anaconda.org/anaconda/linux-64/libsodium-1.0.18-h7b6447c_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.2-h58526e2_4.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/openssl-1.1.1k-h7f98852_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.5-h516909a_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/zlib-1.2.11-h516909a_1010.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/readline-8.1-h46c0cb4_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.10-h21135ba_1.tar.bz2
https://conda.anaconda.org/anaconda/linux-64/zeromq-4.3.3-he6710b0_3.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/sqlite-3.35.5-h74cdb3f_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/python-3.9.2-hffdb5ce_0_cpython.tar.bz2
https://conda.anaconda.org/anaconda/noarch/backcall-0.2.0-py_0.tar.bz2
https://conda.anaconda.org/anaconda/noarch/decorator-4.4.2-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/ipython_genutils-0.2.0-py_1.tar.bz2
https://conda.anaconda.org/anaconda/noarch/parso-0.8.0-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/pickleshare-0.7.5-py_1003.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd3deb0d_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.9-1_cp39.tar.bz2
https://conda.anaconda.org/anaconda/noarch/six-1.15.0-py_0.tar.bz2
https://conda.anaconda.org/anaconda/noarch/wcwidth-0.2.5-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/wheel-0.36.2-pyhd3deb0d_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/certifi-2020.12.5-py39hf3d152e_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/jedi-0.18.0-py39hf3d152e_2.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/pexpect-4.8.0-pyh9f0ad1d_2.tar.bz2
https://conda.anaconda.org/anaconda/noarch/python-dateutil-2.8.1-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/pyzmq-22.0.3-py39hea8fd45_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/tornado-6.1-py39h3811e60_1.tar.bz2
https://conda.anaconda.org/anaconda/noarch/traitlets-5.0.5-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/jupyter_core-4.7.1-py39hf3d152e_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.1.2-pyhd8ed1ab_2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/setuptools-49.6.0-py39hf3d152e_3.tar.bz2
https://conda.anaconda.org/anaconda/noarch/jupyter_client-6.1.7-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/pip-21.1.1-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/anaconda/noarch/pygments-2.7.1-py_0.tar.bz2
https://conda.anaconda.org/anaconda/noarch/prompt-toolkit-3.0.8-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ipython-7.23.1-py39hef51801_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ipykernel-5.5.4-py39hef51801_0.tar.bz2

P.S. I was getting two types of errors: " ImportError: No module named 'commands ..." (this was related to installing os_sys which in the end, I don't think I need at all.  

The other error was "wheel error" which the new enviornment solved automatically. And the third one was that "f77: No such file or directo'ry", also some mix-up between the gfortran I had installed and the default name of the



In Ubuntu:

4  pip3 install pypolychord
  485  pip3 install getdist
  486  python3 -m pip install --upgrade pip
  487  pip3 install pil
  488  pip3 install pillow
  489  pip3 install --user pillow
  490  pip3 install getdist
  491  pip3 install statistics
  492  pip3 install sympi
  493  pip3 install sympy
  494  pip3 install os