Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete and/or incorrect installation instructions #15

Open
pcarbo opened this issue Dec 2, 2022 · 5 comments
Open

Incomplete and/or incorrect installation instructions #15

pcarbo opened this issue Dec 2, 2022 · 5 comments

Comments

@pcarbo
Copy link
Contributor

pcarbo commented Dec 2, 2022

It seems that the current feems installation instructions are (a) incomplete and/or (b) incorrect. In particular, I have found that with current conda installations (e.g., miniconda), the installation steps can create conflicts. One underlying issue is that the very specific version requirements of the conda packages make feems difficult to install.

To aid others in installing feems, I was able to successfully install feems after running these commands in a fresh conda environment (I used miniconda):

conda install numpy==1.22.3 scipy==1.5.0 scikit-learn==0.23.1
conda install matplotlib==3.2.2 pyproj==2.6.1.post1 networkx==2.4.0 
conda install shapely==1.7.1 
conda install fiona
conda install pytest==5.4.3 pep8==1.7.1 flake8==3.8.3
conda install click==7.1.2 setuptools pandas-plink
conda install msprime==1.0.0 statsmodels==0.12.2 PyYAML==5.4.1
conda install xlrd==2.0.1 
conda install openpyxl==3.0.7
conda install suitesparse=5.7.2
conda install scikit-sparse=0.4.4 
conda install cartopy=0.18.0

Then I downloaded feems and ran

cd feems
pip install .

But before I did this I replaced the contents of requirements.txt with:

numpy
scipy
scikit-learn
matplotlib
pyproj
networkx
shapely
fiona
pytest
pep8
flake8
click
setuptools
pandas-plink
msprime
statsmodels
PyYAML
xlrd
openpyxl

However, please note that these steps may not be complete (I have not tested the installation extensively), and therefore will need to be confirmed (and possibly improved) by others. Any suggestions for improvement to these instructions are welcome.

@karolisr
Copy link

karolisr commented Dec 8, 2022

I went through a similar journey and had a similar solution. Of all the versioned packages, only these require specific versions on 12/08/2022:

matplotlib==3.4.2
networkx==2.4.0

Below is a bash script that I put together for Python 3.10 on Ubuntu 22.04 / macOS Ventura and does not require Conda. Prerequisite installation commands for Mac / Ubuntu are commented out and use brew / apt, respectively. The script will create a venv named venv-py310-feems in ${VENVDIR} that can be set by the user:

#!/usr/bin/env bash

deactivate &> /dev/null
conda deactivate &> /dev/null

# macOS
# brew install gdal geos gsl suite-sparse proj
# export CFLAGS="-I/opt/homebrew/include"

# Ubuntu
# sudo apt install python3.10-venv gdal-bin gdal-data libgdal-dev python3-gdal libgdal-grass geos-bin libgeos-dev gsl-bin libgsl-dev libsuitesparse-dev proj-bin libproj-dev

TEMPDIR="${HOME}/feems-temp-dir"
VENVDIR="${HOME}/.venvs"

mkdir -p "${TEMPDIR}"
cd "${TEMPDIR}"
rm -rf ./feems-repo

python3.10 -m venv "${VENVDIR}/venv-py310-feems"
source "${VENVDIR}/venv-py310-feems/bin/activate"

pip install --upgrade pip
pip install wheel
pip install ipython
pip install shapely --force-reinstall --no-cache-dir --no-binary shapely

# ----------------------------------------------------------------------------
tee requirements.txt <<EOF
setuptools
flake8
pep8
pytest
fiona
click
numpy
scipy
pyproj
scikit-learn
pandas-plink
msprime
statsmodels
openpyxl
xlrd
PyYAML
scikit-sparse
cartopy
matplotlib==3.4.2
networkx==2.4.0
shapely
EOF
# ----------------------------------------------------------------------------

pip install -r requirements.txt
git clone https://github.com/NovembreLab/feems feems-repo
mv feems-repo/requirements.txt feems-repo/requirements.txt.bak
cp requirements.txt feems-repo/requirements.txt
pip install ./feems-repo

deactivate

cd

rm -rf "${TEMPDIR}"

@pcarbo
Copy link
Contributor Author

pcarbo commented Dec 9, 2022

@karolisr thank you for sharing this!

@pcarbo
Copy link
Contributor Author

pcarbo commented Apr 4, 2023

Thanks to @hmoots for sharing her conda environment specs, which can be used to install feems in only a couple easy steps:

conda create --name feems2 --file feems.txt
# Then clone or download feems from GitHub.
cd feems
pip install .

feems.txt

@macurqcron
Copy link

macurqcron commented Mar 1, 2024

Adding to this issue, I recently installed feems on my Mac (osx-arm64 environment) using this code

conda create -n=feems_e python=3.8 
conda activate feems_e

brew install geos

conda install numpy scipy scikit-learn
conda install matplotlib==3.4.2 pyproj networkx==2.4.0 
conda install shapely
conda install fiona
conda install pytest pep8 flake8
conda install conda-forge::openblas
conda install click setuptools
pip install pandas-plink
conda install msprime statsmodels PyYAML
conda install xlrd 
conda install openpyxl
conda install suitesparse
conda install scikit-sparse 
conda install cartopy

pip install git+https://github.com/NovembreLab/feems

I also had to go in and manually change a numpy function (num.int -> int) in some of the python scripts associated with the packages before everything would run (the error messages were helpful in finding files and code lines). I also had to manually install notebook for jupyter to run the software.

@GabrieleNocchi
Copy link

installation of this thing is a nightmare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants