bbalasub1 / glmnet_python

GNU General Public License v3.0
199 stars 93 forks source link

Image Not Found with Mac OS #56

Closed kevinegan31 closed 3 years ago

kevinegan31 commented 3 years ago

I am currently trying to run glmnet_python on my Mac OS with Python 3.7.3 and am running into the below issue when trying to run the code from the vignette.

fit = glmnet(x = x.copy(), y = y.copy(), family = 'gaussian', \
                    weights = wts, \
                    alpha = 0.2, nlambda = 20
                    )
OSError: dlopen(/Users/kevinegan/anaconda3/lib/python3.7/site-packages/glmnet_python/GLMnet.so, 6): image not found

I am also trying to run this on Google Colab, but get the below error when trying to import glmnet_python:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-50-2da1d7aed75d> in <module>()
----> 1 import glmnet_python
      2 from glmnet import glmnet

1 frames
/usr/local/lib/python3.7/dist-packages/glmnet_python/cvglmnet.py in <module>()
    200 from glmnetPredict import glmnetPredict
    201 import scipy
--> 202 from glmnet import glmnet
    203 from cvelnet import cvelnet
    204 from cvlognet import cvlognet

ImportError: cannot import name 'glmnet' from 'glmnet' (/usr/local/lib/python3.7/dist-packages/glmnet/__init__.py)

Is there an easy fix to either of these issues? I'm more concerned with the first problem as I'd like to develop some test code on my local computer.

Thanks.

bbalasub1 commented 3 years ago

That seems like an installation issue. Please follow installation instructions, and search the issue tracker for similar problems. Note that gfortran compiler is needed for complete install.

On Thu, Mar 25, 2021, 7:23 AM Kevin Egan @.***> wrote:

I am currently trying to run glmnet_python on my Mac OS with Python 3.7.3 and am running into the below issue when trying to run the code from the vignette.

fit = glmnet(x = x.copy(), y = y.copy(), family = 'gaussian', \ weights = wts, \ alpha = 0.2, nlambda = 20 ) OSError: dlopen(/Users/kevinegan/anaconda3/lib/python3.7/site-packages/glmnet_python/GLMnet.so, 6): image not found

I am also trying to run this on Google Colab, but get the below error when trying to import glmnet_python:


ImportError Traceback (most recent call last)

in () ----> 1 import glmnet_python 2 from glmnet import glmnet 1 frames /usr/local/lib/python3.7/dist-packages/glmnet_python/cvglmnet.py in () 200 from glmnetPredict import glmnetPredict 201 import scipy --> 202 from glmnet import glmnet 203 from cvelnet import cvelnet 204 from cvlognet import cvlognet ImportError: cannot import name 'glmnet' from 'glmnet' (/usr/local/lib/python3.7/dist-packages/glmnet/__init__.py) Is there an easy fix to either of these issues? I'm more concerned with the first problem as I'd like to develop some test code on my local computer. Thanks. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe .