I found a small bug in a R package. I communicated with the package author to update the code. While waiting for the author action to fix the bug, I am trying to fix the bug on my local version of the package.
I changed the R code, and also updated the MD5 of the associated file. The package is re-zipped, and I use this command to install it:
install.packages("path/to/the/file/modified_package.zip", repos = NULL)
it seems the installation is going well:
Installing package(s) into ‘C:/Users/Me/Documents/R/win-library/2.15’
(as ‘lib’ is unspecified)
package ‘x’ successfully unpacked and MD5 sums checked
However, when I try to load the package, there is an error:
> library(x)
Error in library(x) : ‘x’ is not a valid installed package
Any thoughts?
You can't just zip up the directories; you need to rebuild the package.
There are loads of guides around on how to build R packages. The easiest way (imho) is to use the devtools package.
library(devtools)
build("path/to/the/package")
install.packages("path/to/built/package.tar.gz", repos = NULL, type = "source")
Or
build("path/to/the/package", binary = TRUE)
install.packages("path/to/built/package.zip", repos = NULL, type = "win.binary")
You'll also need Rtools if you are running Windows. Install it with the installr package.
library(installr)
install.Rtools()
Related
I need to install R-INLA on R 4.1.1 (Windows 10). I cannot update the R version due to compatibility issues of the newer R installations with other tools I that use. I tried the line:
remotes::install_version("INLA", version="22.05.03",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE)
As recommended on the INLA website for R 4.1. I get this message in return:
* installing *binary* package 'INLA' ...
cp: unknown option -- )
Try '/usr/bin/cp --help' for more information.
ERROR: installing binary package failed
* removing 'C:/Program Files/R/R-4.1.1/library/INLA'
I have rtools40 installed and added to my path. I have installed the two suggested packages graph and Rgraphviz as recommended.
I have also tried:
devtools::install_github(repo = "https://github.com/hrue/r-inla", ref = "stable", subdir = "rinla", build = FALSE)
But no luck there either.
If I type where cp in the RStudio terminal, I get:
$ where cp
C:\Program Files\Git\usr\bin\cp.exe
C:\rtools40\usr\bin\cp.exe
But I am not sure if this has anything to do with R not finding cp.
Anyone has any advice?
I was having the same problem, and solved it for my Windows 10 machine:
Download the INLA_22.05.03.zip file at https://inla.r-inla-download.org/R/stable/bin/windows/contrib/4.1/
In RStudio, under the Tools menu, select Install Packages, and Install from: Package Archive File. Tell RStudio where the .zip file is located on your local machine. From there it installed fine for me.
I install asammdf package to read dat file in python. After installing asammdf using pip install asammdf, the installation is successful. However, when I import asammdf, I got ldf is not supported.
May I know how to solve this issue and after installing the asammdf? Moreover I also cannot open the spyder in my anaconda
That is just a warning message from the canmatrix library. If you don't use LIN database file (ldf files) for bus logging decoding then you can just ignore it.
If you really want to make it go away then just install the ldfparser package since this is required for ldf support ( see
https://github.com/ebroecker/canmatrix/blob/6ed291b73a5824e367615c99ee1b4e6084eb026e/setup.py#L98)
I am trying to install qt/5.14.2 with conan.
Using
qt/5.14.2#bincrafters/stable
I receive
ERROR: libpq/11.5: Error in package_info() method, line 211
self.cpp_info.components["pq"].requires.append("zlib::zlib")
AttributeError: 'Component' object has no attribute 'requires'
OK, there is a bug in libpq/11.5
I am trying to downgrade to
libpq/11.4#bincrafters/stable
ERROR: Conflict in qt/5.14.2#bincrafters/stable:
'qt/5.14.2#bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4#bincrafters/stable' requires 'zlib/1.2.11#conan/stable'.
To fix this conflict you need to override the package 'zlib' in your root package.
BTW:
Why is it not enough to require the correct version of the library, and requiring the same repository? (and require two different repositories in two different packages for the same dependence)
OK, I attempted
zlib/1.2.11#bincrafters/stable
WARN: libpq/11.4#bincrafters/stable: requirement zlib/1.2.11#conan/stable overridden by your conanfile to zlib/1.2.11#bincrafters/stable
zlib/1.2.11#bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11#bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11#bincrafters/stable: Trying with 'minres'...
zlib/1.2.11#bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11#bincrafters/stable' from 'libpq/11.4#bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11#bincrafters/stable' in remotes
Finally, I arrived at
libpq/11.4#bincrafters/stable
zlib/1.2.11#conan/stable
qt/5.14.2#bincrafters/stable
After this, it looks like it was oK:
Installing (downloading, building) binaries...
qt/5.14.2#bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2#bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2#bincrafters/stable: Downloaded package revision 0
However, the install fails with
CMake was unable to find Qt5, put qmake in your path or set
QTDIR/QT_QMAKE_EXECUTABLE.
The package is downloaded, I see all components in the corresponding subdirectory in my home directory. However, unlike the other components, it is not installed, before CMake attempts to find it.
What do I wrong?
In case of any strange behavior of conan, upgrade! For me, switch 1.24.0 -> 1.28.1 with configs clean up fixed the same problem with libpq/11.5
I'm trying to install the package "Tax4Fun" but keep failing.
I've tried 2 different ways:
install.packages("devtools")
devtools::install_url("http://tax4fun.gobics.de/Tax4Fun/Tax4Fun_0.3.1.tar.gz")
library(Tax4Fun)
The error that I get is:
ERROR: dependency 'biom' is not available for package 'Tax4Fun'
I've also tried installing biom directly
BiocManager::install("biom")
which does not work either
Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installing package(s) 'biom'
Installation path not writeable, unable to update packages: boot, foreign, KernSmooth,
mgcv, nlme, survival
Warning message:
package ‘biom’ is not available (for R version 3.6.1)
The other way I've tried to install Tax4Fun directly is
BiocManager::install("Tax4Fun")
I get the following error code:
Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installing package(s) 'Tax4Fun'
Installation path not writeable, unable to update packages: boot, foreign, KernSmooth,
mgcv, nlme, survival
Warning message:
package ‘Tax4Fun’ is not available (for R version 3.6.1)
Please help :)
You need to install it by downloading the packages from source (http://tax4fun.gobics.de). Then it depends whether you are running on Linux/Mac or Windows.
From the command line, you navigate to the folder containing the .tar.gz downloaded package. Then you should install it using:
R CMD INSTALL Tax4Fun_0.3.1.tar.gz
But dependancies are not installed by default. So you need to install dependancies manually, Qiimer and Biom, which are both deprecated on Cran. You install them using the same command, after you have downloaded the packages from the Cran archives.
Before that, you need to also install their dependancies in R:
install.packages("pheatmap")
install.packages("RJSONIO")
Then you should be able to proceed as mentioned above: install Qiimer and Biom from the command line first. Then Tax4Fun from the command line too.
If you are running on Windows you should have quite the same issues, but the installation of the different packages and dependancies is different. You can have a look at the readme at http://tax4fun.gobics.de
I am having difficulties with installing plyr in R (on Ubuntu). The very same problem has been posted in various forums before (in fact I just posted this myself a while ago), but none of the suggested solutions there worked for me.
To summarize, I am trying to install it using this command (output below):
install.packages("plyr")
Installing package into ‘/home/m2108/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning message:
package ‘plyr’ is not available (for R version 3.0.2)
Then I have tried to manually download the package from the cran server and use this command instead and receive the same error:
install.packages("~/Downloads/plyr_1.8.2.tar.gz", repos = NULL, type = "source") Installing package into ‘/home/m2108/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) ERROR: this R is version 3.0.2, package 'plyr' requires R >= 3.1.0 Warning in install.packages : installation of package ‘/home/m2108/Downloads/plyr_1.8.2.tar.gz’ had non-zero exit status
I have also ensured that I have internet access from within R. I have also tried to run the installation from within RStudio and from the console.
Does anyone have an idea, what I might be doing wrong?