cmmid / covid-uk

Scenario analyses for COVID-19 outbreak in the United Kingdom
GNU General Public License v3.0
64 stars 28 forks source link

Installation problem #4

Closed pnavaro closed 3 years ago

pnavaro commented 4 years ago

Hello, this is not an issue but If you have some problems to run this code like me. I succeed by using miniconda.

You need to download this file https://github.com/pnavaro/covid-uk/blob/master/conda/environment.yml

and type

cd covid-uk
conda env create -f conda/environment.yml
conda activate covid-uk
Rscript UK.R 1 50

I hope it helps

Thanks for sharing this

Pierre

paultanger commented 4 years ago

Very cool! How long does it take to run?

pnavaro commented 4 years ago

18 hours ! (Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz)

alex6092400 commented 4 years ago

Hello ! What kind of problems did you have when you ran the code for the first time ?

pnavaro commented 4 years ago
from corona.cpp:8:
covidm/model_v1/process.h:23:5: error: 'string' does not name a type
     string source_name;     // name of the above

covidm/model_v1/process.h:27:5: error: 'vector' does not name a type
     vector<unsigned int> ids;   // identifiers of sub-process compartments
alex6092400 commented 4 years ago

I have the same problem and i tried your method but it doesn't work for me. I've installed miniconda, then i download your file, put it in the directory covid-uk-master and in the anaconda prompt i've typed what you said but i get:

Collecting package metadata (repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://conda.anaconda.org/conda-forge/win-64/repodata.json

Elapsed: -

An HTTP error occurred when trying to retrieve this URL.

HTTP errors are often intermittent, and a simple retry will get you on your way.

'https://conda.anaconda.org/conda-forge/win-64'

pnavaro commented 4 years ago

It seems to be a network issue, here the steps:

cd covid-uk
conda env create -f environment.yml
conda activate covid-uk
Rscript UK.R 1 50
alex6092400 commented 4 years ago

I've finally succeed !! But still doesn't work, i get this type of error:

Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'H:/Documents/covid-uk-master/covidm/build/sourceCpp-x86_64-w64-mingw32-1.0.4.6/sourcecpp_143c1f1831/sourceCpp_30.dll': LoadLibrary failure: The specified module could not be found. Calls: source ... source -> withVisible -> eval -> eval -> dyn.load -> inDL

pnavaro commented 4 years ago

I think it is a problem with the compiler. I am not a Windows user but try this

conda update r-essentials -n covid-uk -c r
conda activate covid-uk
Rscript UK.R 1 50
alex6092400 commented 4 years ago

I get this when i try conda update r-essentials -n covid-uk -c r :

PackageNotInstalledError: Package is not installed in prefix. prefix: C:\Users\Admin\anaconda3\envs\covid-uk package name: r-essentials

pnavaro commented 4 years ago

Install sorry not update

conda install r-essentials -n covid-uk -c r
alex6092400 commented 4 years ago

I get Solving environment: failed with initial frozen solve. Retrying with flexible solve and Solving environment : Found conflicts ! and UnsatisfiableError: The following specifications were found to be incompatible with a past explicit spec that is not an explicit spec in this operation (r-stringr):

pnavaro commented 4 years ago

Probably it was not a good idea to change the conda channel

conda install r-essentials -n covid-uk -c conda-forge 

I already went through this with a colleague. Unfortunately my solution doesn’t seem robust. 😅

alex6092400 commented 4 years ago

I still get the LoadLibrary failure error... Maybe it is due to my system variables PATH ?

pnavaro commented 4 years ago

You can try to remove the directory covidm/build/ to force rebuild.

alex6092400 commented 4 years ago

Still getting the same error...

pnavaro commented 4 years ago

It is an issue with Rcpp, did you try a simple command ?

Rcpp::evalCpp("2+2")
alex6092400 commented 4 years ago

I've just tried this and yes it works

pnavaro commented 4 years ago

Perhaps this https://stackoverflow.com/questions/52150491/error-in-indlx-as-logicallocal-as-logicalnow-unable-to-load-share

pnavaro commented 4 years ago

You can try to install mingw-w64 but i am afraid some side effets could happen... Using conda is safer, perhaps you could find it with

conda search mingw

I am not sure

alex6092400 commented 4 years ago

When i type sessionInfo() i get this : Problem_2

Maybe the problem is in not attached packages ?

pnavaro commented 4 years ago

OK i have the R 3.6 and i try to upgrade to 4.0 and i get same error

in environment.yml file replace the pattern conda-forge by r

then deactivate the covid-uk env

conda deactivate

remove the covid-uk env

conda env remove -n covid-uk

recreate the covid-uk with the r channel

conda env create -f environment.yml
conda activate covid-uk
Rscript UK.R 1 50
pnavaro commented 4 years ago

Probably the r channel is more stable than conda-forge for R users. Sorry but it is late in France and i have to go. I hope it works 🤞

alex6092400 commented 4 years ago

when i try to create i get this

`Solving environment: failed

ResolvePackageNotFound:

pnavaro commented 4 years ago

I uploaded a new version of https://github.com/pnavaro/covid-uk/blob/master/conda/environment.yml You can try it

condo activate covid-uk
conda env update -f environment.yml
alex6092400 commented 4 years ago

it works !! Thank you so much !! I have some issues with the UK-view.R but i hope i will fix it !