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

Can't successfully install CAM package #34

Closed
smile0925 opened this issue Oct 29, 2021 · 7 comments
Closed

Can't successfully install CAM package #34

smile0925 opened this issue Oct 29, 2021 · 7 comments

Comments

@smile0925
Copy link

I download the CAM_1.0.tar.gz and run the setup_CAM.py, but when check if CAM and mboost have been installed, get 'need to install CAM and mboost'. I can't install CAM successfully.
image

@shertheus
Copy link

I download the CAM_1.0.tar.gz and run the setup_CAM.py, but when check if CAM and mboost have been installed, get 'need to install CAM and mboost'. I can't install CAM successfully. image
Did you solve it? I also encountered the same problem.

@shaido987
Copy link
Collaborator

shaido987 commented Nov 26, 2021

It's possible that the problem is due to some missing dependencies that can occur when running on a linux based system. You can try and see if the fix mentioned here solves the issue, i.e., running:

sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev

Also, you can try set the mirror used for accessing the packages (see here) by adding a line to setup_CAM.py (after line 3):

utils.chooseCRANmirror(ind=1)

@cczhangy
Copy link

I have implemented as you said, but still report an error, the result of the error is the same as above @shaido987

@shaido987
Copy link
Collaborator

@cczhangy You can try to install CAM using the RStudio IDE instead of using rpy2.

  1. First, make sure R is installed (https://cran.r-project.org/).
  2. Install RStudio from https://www.rstudio.com/products/rstudio/download/
  3. Install all dependences, i.e.: Matrix, mgcv, codetools, rpart, glmnet, mboost. See here for a quick how-to: http://derekogle.com/IFAR/supplements/installations/InstallPackagesRStudio.html
  4. Download CAM_1.0.tar.gz from https://cran.r-project.org/package=CAM
  5. Install using the same method as in 3, but change 'install from' to 'Package Archive File' and select the downloaded CAM_1.0.tar.gz file.

You can now use python to check so rpy2 can access the installed packages:

import rpy2.robjects.packages as rpackages

utils = rpackages.importr('utils')

if rpackages.isinstalled('CAM') and rpackages.isinstalled('mboost'):
    print('R packages CAM and mboost have been installed.')
else:
    print('Packages not installed correctly.')

@cczhangy
Copy link

@shaido987 I have executed as you said and got the following two errors when running
python version3.6.13
from typing import Protocol
ImportError:cantnot import name 'Protocol'

AttributeError:module 'typing' has no attribute '_SpecialForm'

@shaido987
Copy link
Collaborator

@cczhangy It looks like you have some python versioning issue unrelated to the CAM package installation. I don't know what is wrong but the answers here: https://stackoverflow.com/questions/54274630/can-not-import-protocol-from-typing, suggest installing/upgrading the typing_extensions package or upgrading the python version.

@cczhangy
Copy link

Ok,thank you very much!

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