DLL not found: maybe not installed for this architecture?

Package dependencies not installed

I've installed a fresh copy of RStudio on a shiny new Windows notebook.
However, few if any of the installed packages are working successfully, perhaps due to a failure to install needed dependencies.

Steps taken so far -

  • Installed RStudio on a fresh laptop
  • Deselected Tools > Global Options > Restore .RData into workspace at startup
  • quit and Restarted RStudio
  • used "Install Packages" from menu to install a package, being sure to select "Install Dependencies"
  • once that appears to succesfully execute, I call the package with library(), which then complains that dependencies are missing.

Here's an example using the package 'plm'

  1. "Install Packages" produces and runs the code

install.packages("plm")

producing the output

Installing package into ‘C:/Users/00011124/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/plm_2.2-2.zip'
Content type 'application/zip' length 1679303 bytes (1.6 MB)
downloaded 1.6 MB

package ‘plm’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in

  • C:\Users\00011124\AppData\Local\Temp\RtmpIv24hI\downloaded_packages*
  1. library(plm)

then produces

Error: package or namespace load failed for ‘plm’ in library.dynam(lib, package, package.lib):
DLL ‘zoo’ not found: maybe not installed for this architecture?

Suggestions gratefully received.

System Information:

  • RStudio Edition: Desktop
  • RStudio Version: 'Orange Blossom' 1.2.5033
  • OS Version: Win 10 x64
  • R Version: 3.6.2 (2019-12-12)

Also:

  • Your sessionInfo():
    R version 3.6.2 (2019-12-12)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] MASS_7.3-51.4 compiler_3.6.2 magrittr_1.5 tools_3.6.2
[5] bdsmatrix_1.3-4 stringi_1.4.6 grid_3.6.2 gbRd_0.4-11
[9] stringr_1.4.0 Formula_1.2-3 bibtex_0.4.2.2 Rdpack_0.11-0
[13] lattice_0.20-38


From Troubleshooting Guide: Using RStudio

try

install.packages("zoo")

What happens if you reinstall zoo package

install.packages("zoo")
> install.packages("zoo")

Installing package into ‘C:/Users/00011124/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/zoo_1.8-7.zip'
Content type 'application/zip' length 1108097 bytes (1.1 MB)
downloaded 1.1 MB

package ‘zoo’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\00011124\AppData\Local\Temp\RtmpIv24hI\downloaded_packages
> library(plm)

Error: package or namespace load failed for ‘plm’ in get(Info[i, 1], envir = env):
 lazy-load database 'C:/Users/00011124/Documents/R/win-library/3.6/zoo/R/zoo.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompr

Can you try on a fresh R session? You can restart your R session with Ctrl+Shift+F10

Restarting R session...

library(plm)

Error: package or namespace load failed for ‘plm’ in library.dynam(lib, package, package.lib):
DLL ‘lmtest’ not found: maybe not installed for this architecture?

Can you install this one too, restart your session and try again?
You are going to have to repeat this process until there are no package dependencies missing.

Andresrcs, I appreciate your effort, but the point is

  • The problem is not just getting one package to run; the problem is getting a wide range of packages to run
  • package installation is supposed to track and automatically install dependencies...and has always done so for me in previous configurations. Something is systematically wrong here that needs fixing.

Not by default, you can try setting dependencies = TRUE while installing but very likely this is going to happen from time to time, that is why this forum has lots and lots of topics like yours.

1 Like

Regarding defaults,

  • My reading of the manpage for install.packages() is that dependencies = NA is the default, , and it states The default, NA, means c("Depends", "Imports", "LinkingTo")
  • I noted at the outset that when installing packages through the menu system, I selected the "install dependencies" option.

I don't think the dependencies are being installed, despite this.
I think you agree.

Does that seem odd to you, or is it just me?

Yes, it is odd, but being R open source and packages freely contributed by a large number of people, I think you just have to learn to live with this.

After a bit more troubleshooting, I found the following to work.

install.packages("plm",dependencies = TRUE)

Despite having previously tried to install the plm package with the default dependencies = NA, using dependencies = TRUE as andresrcs previously suggested installed roughly 40 new packages. However, then trying

library(plm)

produced evidence of more missing dependencies

DLL ‘lmtest’ not found: maybe not installed for this architecture?

Following this with

install.packages("lmtest",dependencies = TRUE)

installed an additional 3 packages. After restarting R with Ctrl-Shift-F10

library(plm)

then worked correctly.

Lesson learned: don't trust the default dependencies = NA, use dependencies=TRUE and iterate as required, restarting R to clear warnings that lazy-load database XXXXXXX is corrupt

2 Likes

Question to long time R experts on the forum, is this issue something like install.packages() doing a reasonable job of identifing and ordering top level dependencies and imports , but not tackling dependencies of dependencies, a la , a recursive scheme ? or would it normally try to do that ?
Browsing around, I saw that someone had make an explicit approach to try to track all dependencies down the tree, is that to plug a known gap with install.packages. or is this a misunderstanding ?

I'm admittedly the opposite of a long time R expert, but as a casual user for > 5 yrs, I've never run into this kind of dependency problem using earlier versions of RStudio. In contrast, with the current version I'm running into this with most packages that I try to install.

This appears to be a previously solved problem that has resurfaced.

Rstudio is an IDE it has little to nothing to do with the package installation (other than providing a GUI if you choose to use it).

Quite.

So would you agree that this appears to be a previously solved problem in R that has resurfaced?

Not in my experience, this kind of installation problems happen all the time and I honestly can't remember any moment since I use R where this sort of things weren't an issue.

I suspect that the hassle free installation experience that you remember was related to you having a package library with a lot of the package dependencies already installed thus avoiding this kind of problems but since you updated your setup that is no longer the case right now, but after some installation processes you are going to start getting the same experience as before.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.