Unable to install packages in R Studio

Hello.

I've got a series of problems today that I didnt have before.

First of all, after an R studio update, I got the follow error installing the R studio newest version.

the procedure entry point GetPackageFamilyName could not be located in the dynamic link library KERNEL32.dll

I updated multiple versions of R and R Studio and nothing worked. Until, I installed 4.3 version. (This pc is windows 7, x64)

Once I kinda solved the first issue, now I cant install any package in any way, I tried the following:

  1. Reinstalling R Studio
  2. "Use secure download method for HTTP" was already unmarked
  3. Tried to change primary CRAN repository from Global to Mexico (i'm here right now)

Here output I've got

Warning message:
In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
  URL 'https://cran.r-project.org/CRAN_mirrors.csv': Timeout of 60 seconds was reached
> Sys.setlocale("LC_ALL", "UTF-8") 
[1] ""
Warning message:
In Sys.setlocale("LC_ALL", "UTF-8") :
  OS reports request to set locale to "UTF-8" cannot be honored
> Sys.setlocale("LC_ALL", "Spanish_Mexico.1252") 
[1] "LC_COLLATE=Spanish_Mexico.1252;LC_CTYPE=Spanish_Mexico.1252;LC_MONETARY=Spanish_Mexico.1252;LC_NUMERIC=C;LC_TIME=Spanish_Mexico.1252"
> options(scipen=999) 
> #Configuración----
Warning message:
In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
  URL 'https://cran.r-project.org/CRAN_mirrors.csv': Timeout of 60 seconds was reached
> Sys.setlocale("LC_ALL", "UTF-8") 
[1] ""
Warning message:
In Sys.setlocale("LC_ALL", "UTF-8") :
  OS reports request to set locale to "UTF-8" cannot be honored
> Sys.setlocale("LC_ALL", "Spanish_Mexico.1252") 
[1] "LC_COLLATE=Spanish_Mexico.1252;LC_CTYPE=Spanish_Mexico.1252;LC_MONETARY=Spanish_Mexico.1252;LC_NUMERIC=C;LC_TIME=Spanish_Mexico.1252"
> options(scipen=999) 
Warning: unable to access index for repository http://cran.itam.mx/src/contrib:
  cannot open URL 'http://cran.itam.mx/src/contrib/PACKAGES'
Warning: unable to access index for repository http://cran.itam.mx/src/contrib:
  cannot open URL 'http://cran.itam.mx/src/contrib/PACKAGES'
> install.packages(readxl)
Error in install.packages : object 'readxl' not found
> options("download.file.method"="wininet")
> download.file("https://cran.r-project.org/CRAN_mirrors.csv",destfile = "cmir.csv")
trying URL 'https://cran.r-project.org/CRAN_mirrors.csv'
Content type 'text/csv' length 17341 bytes (16 KB)
downloaded 16 KB

Warning message:
In download.file("https://cran.r-project.org/CRAN_mirrors.csv",  :
  the 'wininet' method is deprecated for http:// and https:// URLs
> options("download.file.method"="libcurl")
> download.file("https://cran.r-project.org/CRAN_mirrors.csv",destfile = "cmir.csv")
trying URL 'https://cran.r-project.org/CRAN_mirrors.csv'
Error in download.file("https://cran.r-project.org/CRAN_mirrors.csv",  : 
  cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'
In addition: Warning message:
In download.file("https://cran.r-project.org/CRAN_mirrors.csv",  :
  URL 'https://cran.r-project.org/CRAN_mirrors.csv': Timeout of 60 seconds was reached
> getOption("download.file.method")
[1] "libcurl"
> install.packages("RCurl")
Warning in install.packages :
  unable to access index for repository http://cran.itam.mx/src/contrib:
  cannot open URL 'http://cran.itam.mx/src/contrib/PACKAGES'
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Finanzas-CDMX/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository http://cran.itam.mx/src/contrib:
  cannot open URL 'http://cran.itam.mx/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘RCurl’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
  unable to access index for repository http://cran.itam.mx/bin/windows/contrib/4.3:
  cannot open URL 'http://cran.itam.mx/bin/windows/contrib/4.3/PACKAGES'

RStudio has required Windows 10 for years, so I am surprised that it works at all on Windows 7.

OTOH, it seems like that http :// mirror and the wininit method works for you, so why don't you set up both and give it a try?

If you want to use the UTF-8 locale, you'll probably need to install some extra software: Update for Universal C Runtime in Windows - Microsoft Support

Yes, it worked just fine for years. I updated it and that's what I got.

How do I set up both methods?

Like you did it above. Actually, from your output it seemed that the main CRAN repo also worked:

Sys.setlocale("LC_ALL", "Spanish_Mexico.1252")
options(download.file.method = "wininet")
options(repos = "https://cran.r-project.org")
install.packages(readxl)

Well, Windows 7 support ended more than 3 years ago. It is worth checking the requirements of software, e.g. RStudio has Windows 10 as a requirement on the download page.

I set up Windows 10 on the computer. I wrote what you say and didn't work either. So I'm having this issue again.

So if you run these , what is the output that you get?

I did it 3 times, and in the 3rd one worked, for some reason, I cant explain. I tried to install a package via zip file (that didnt work for hours) and after I wrote this, worked.

Could you tell me what does wininet mean?

Thanks Gabor

See ?download.file for wininet. But I believe you don't actually need it on Windows 10.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.