jeancmaia / mcglm

Python Framework for Multivariate Covariance Generalized Linear Models
https://mcglm.readthedocs.io/
ISC License
1 stars 1 forks source link

Installation fails via pip (macOS) #5

Closed Spaak closed 10 months ago

Spaak commented 11 months ago

Hi, I'm a reviewer for JOSS and am trying to install mcglm via pip (see review thread here https://github.com/openjournals/joss-reviews/issues/6037).

To emulate a typical (using conda), yet still clean (fresh environment), setup, I went:

conda create -n reviewmcglm
conda activate reviewmcglm
conda install python=3.9
conda install patsy matplotlib statsmodels scipy numpy pandas seaborn

which all went fine. Note that I installed the dependencies here already via conda (the 'default' versions).

Then I went:

pip install mcglm

which resulted in several errors (see below), which appear to be related to pip trying to compile numpy and failing. This is not something I've encountered before (and have used numpy on many occasions in many different settings), so I suspect it's due to something strange in the dependencies and/or the relation to my machine (an M1 (ARM) mac). I did notice that in mcglm's dependencies you specify exact versions of libraries, rather than accepted ranges. This I suspect is in general undesirable, and installing mcglm should be possible in a typical conda setup like I showed above. A fix here would be appreciated so I can install and continue to review :) (I'm deliberately not installing via git pull since installation is part of the review.)

Full output of failing pip install

Spaak commented 11 months ago

I get the same (or similar) errors if I just create a clean conda env, install only python in it (and dependencies, including pip), and then do pip install mcglm, so without first installing any further dependencies via conda.

jeancmaia commented 11 months ago

Hey, Spaak. Thank you for reaching out, and sorry for this annoying setback. I have overhauled the library, which looks correct at the moment. Check out the logs:

conda create -n reviewmcglm1
source activate reviewmcglm1
pip install mcglm
Collecting mcglm
  Downloading mcglm-0.2.2-py3-none-any.whl (23 kB)
Collecting numpy<2.0,>=1.25
  (18.2 MB)
     |████████████████████████████████| 18.2 MB 1.4 MB/s 
Collecting pandas<2.0.0,>=1.3.3
(12.2 MB)
     |████████████████████████████████| 12.2 MB 56 kB/s 
Collecting matplotlib<4.0.0,>=3.5.2
 (11.6 MB)
     |████████████████████████████████| 11.6 MB 1.9 MB/s 
Collecting statsmodels<0.14.0,>=0.13.2
 (9.9 MB)
Collecting patsy<0.6.0,>=0.5.2
(233 kB)
     |████████████████████████████████| 233 kB 5.0 MB/s 
conda create -n reviewmcglm2
source activate reviewmcglm2
pip install patsy matplotlib statsmodels pandas numpy
pip install mcglm

To fix it, I have weeded out unnecessary requirements and polished all library version specifications. Could you try it out again? Thank you so much.

Spaak commented 10 months ago

Fixed 🎉