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

Loading packages after installation #337

Closed
Faizal-Eeman opened this issue Sep 19, 2023 · 1 comment
Closed

Loading packages after installation #337

Faizal-Eeman opened this issue Sep 19, 2023 · 1 comment

Comments

@Faizal-Eeman
Copy link

Faizal-Eeman commented Sep 19, 2023

I've followed the steps to download and install a package, and the log says that the package has been installed. However, when I load the package with library(), I'm thrown with an error stating there is no such package.

pdl <- new_pkg_download_proposal("dplyr")
pdl$resolve()
pdl$download()

lib <- tempfile()
dir.create(lib)
pdi <- new_pkg_installation_proposal(
  "dplyr",
  config = list(library = lib)
)
pdi$solve()
pdi$download()
pdi$install()

The last few lines of the install log,

i Building dplyr 1.1.3
v Built dplyr 1.1.3 (8.4s)
v Installed dplyr 1.1.3  (43ms)
v Summary:   16 new  in 1m 34.1s

Now, loading the library

> library(dplyr)
Error in library(dplyr) : there is no package called 'dplyr'

Am I missing something?

-Faizal

@gaborcsardi
Copy link
Member

gaborcsardi commented Sep 19, 2023

lib <- tempfile()
...
  config = list(library = lib)
...

means that the package is installed into a temporary library.

If you want to install it into your default library, omit these, and only write:

pdi <- new_pkg_installation_proposal("dplyr")
pdi$solve()
pdi$download()
pdi$install()

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

2 participants