Glpk: No Such File or Directory Error When Trying to Install R Package

General Questions about installation of igraph and other programs

You need to install Rtools on Windows.
Then you need to add a line in your .Renviron that refers to said Rtools installation. Please read this carefully. Especially the part that says this line has to be in your .Renviron-file: PATH="${RTOOLS40_HOME}\usr\bin;${PATH}".

I'd use usethis::edit_r_environ() to locate the important file.

Secondly, if you need to install anything, then use {installr}-package.

Second part

In case you need to install something as part of the Rtools installation, you need to do the following:

  1. Press Windows-Key and write Rtools Bash. Wait until it finds it, and press Enter.
  2. This will give you a bash terminal within the rtools environment.
  3. Write pacman -Sy in there and press Enter.
  4. Then write pacman -Sy mingw-w64-{i686,x86_64}-glpk mingw-w64-{i686,x86_64}-libxml2 mingw-w64-{i686,x86_64}-gmp and press Enter. (Or whatever else you need to install

This should then do what is needed to install those missing components.

Unable to install RGLPK in Databricks R Notebook

I have finally found the answer through some R&D. Posting here hoping it may help someone in future.

Operating system of Databricks ​is Ubuntu and it requires few dependencies like GLPK,Slam etc.

Slam could be installed easily but GLPK dependency was the main challenge. I did checke in various forums on installing GLPK in ubuntu and majorly all were suggesting installing using sudo command like below:

sudo apt-get install glpk-utils libglpk-dev
But it was not installing and stuck in one place for more then 3 hours. Then i installed in my local ubuntu to understand the flow and noticed that since sudo apt install command was meant for interactive installation, it requires user to enter Yes couple of time.
But Databricks shell terminal is not a interactive window and hence it required a command to force Yes all the time and below is the working command for that:

%sh

sudo apt-get install -y glpk-utils libglpk-dev

Post this you can use install.packages("Rglpk") and it will work like a charm :)
above process can be followed for all non cran packages in Databricks.

Gitlab CI error : Could not build wheels for glpk which use PEP 517 and cannot be installed directly

fatal error: glpk.h: No such file or directory

You are missing the header file(s) for glpk. To make sure this is available, install the library:

RUN apt update && apt install -y libglpk-dev


Related Topics



Leave a reply



Submit