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

Problem with BiocManager connection to Internet under Windows: problem solved #186

Open
lokapal opened this issue Feb 10, 2024 · 5 comments

Comments

@lokapal
Copy link

lokapal commented Feb 10, 2024

For all, whom it may concern - I found the solution what to do, if your R is writing something like:

> BiocManager::install(version="3.14")
Error: Bioconductor version cannot be validated; no internet connection?
In addition: Warning messages:
1: In file(con, "r") :
  InternetOpenUrl failed: 'A connection with the server could not be established'
2: In file(con, "r") :
  InternetOpenUrl failed: 'A connection with the server could not be established'

or (to check Internet connectivity):

> config <- "https://bioconductor.org/config.yaml"
>  readLines(config)
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  InternetOpenUrl failed: 'A connection with the server could not be established'

whereas install.packages working correctly. The solution is:

  1. Put to your .Renviron string
CURL_SSL_BACKEND=openssl
  1. Put to your .Rprofile string
options(download.file.method="libcurl", url.method="libcurl")

and restart R.
All should be working now!

@jcapelladesto
Copy link

Worked for me! Thanks a lot! 👍

@pradeepvpr
Copy link

pradeepvpr commented Mar 8, 2024

Could you please share more details on how to modify the Rprofile and Renviron strings? Or show an example as to how they should look like? I have zero coding experience.. Appreciate the help!

I tried these (below) but it did not resolve the issue for me.

R Profile

CURL_SSL_BACKEND=openssl

# Things you might want to change

# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")

# set the default help type
# options(help_type="text")
  options(help_type="html")

# set a site library
# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")

# set a CRAN mirror
# local({r <- getOption("repos")
#       r["CRAN"] <- "http://my.local.cran"
#       options(repos=r)})

# Give a fortune cookie, but only to interactive sessions
# (This would need the fortunes package to be installed.)
#  if (interactive()) 
#    fortunes::fortune()

R Eviron
options(download.file.method="libcurl", url.method="libcurl")

## from R.sh
R_SHARE_DIR=${R_HOME}/share
R_INCLUDE_DIR=${R_HOME}/include
R_DOC_DIR=${R_HOME}/doc
R_ARCH=

## from Rcmd
R_OSTYPE=windows
TEXINPUTS=.;${TEXINPUTS};${R_SHARE_DIR}/texmf/tex/latex;
BIBINPUTS=.;${BIBINPUTS};${R_SHARE_DIR}/texmf/bibtex/bib;
BSTINPUTS=.;${BSTINPUTS};${R_SHARE_DIR}/texmf/bibtex/bst;

## from etc/Renviron
# R_PLATFORM='i386-pc-mingw32'
R_PAPERSIZE_USER=${R_PAPERSIZE}
R_PAPERSIZE=${R_PAPERSIZE-'a4'}
# for Rd2dpf, reference manual
R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'}
## used for options("texi2dvi")
# R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'texi2dvi'}}
## used by INSTALL, check, build
R_GZIPCMD=${R_GZIPCMD-'gzip'}
## Default zip/unzip commands
R_UNZIPCMD=${R_UNZIPCMD-'unzip'}
R_ZIPCMD=${R_ZIPCMD-'zip'}
R_BZIPCMD=${R_BZIPCMD-'bzip2'}
## Default browser
# R_BROWSER=${R_BROWSER-'open'}
## Default editor
# EDITOR=${EDITOR-${VISUAL-vi}}
## Default pager
# PAGER=${PAGER-''}
## Default PDF viewer
# R_PDFVIEWER=${R_PDFVIEWER-'open'}
# MAKE=${MAKE-make}
SED=${SED-sed}

R_RTOOLS43_PATH="${RTOOLS43_HOME:-c:/rtools43}/x86_64-w64-mingw32.static.posix/bin;${RTOOLS43_HOME:-c:/rtools43}/usr/bin"
#   trailing slash to protect against trailing backslash in PATH
PATH="${R_CUSTOM_TOOLS_PATH:-${R_RTOOLS43_PATH}};${PATH}/"

@LiNk-NY
Copy link
Contributor

LiNk-NY commented Mar 11, 2024

Hi @pradeepvpr
It seems that you are conflating ~/.Rprofile and ~/.Renviron files. These are separate files.
Please see the appropriate sections at https://csgillespie.github.io/efficientR/set-up.html
-Marcel

@isbool
Copy link

isbool commented Jun 23, 2024

I also get this error when I try to install BiocManager in webR.
Tried:
webr::install("BiocManager")
library(BiocManager)

Also tried:
install.packages("BiocManager", repos = c("https://bioconductor.r-universe.dev", "https://repo.r-wasm.org"))
library(BiocManager)

in both cases i get:

An error occurred: Bioconductor version cannot be validated; no internet connection? See #troubleshooting section in vignette

you can test it your self here

@LiNk-NY
Copy link
Contributor

LiNk-NY commented Jun 24, 2024

Hi @isbool
Your question is out of the scope of the issue. Next time, please create a new issue.
You need to enable CORS on your browser for https://webr.r-wasm.org .
Consider using this plugin https://mybrowseraddon.com/access-control-allow-origin.html
Best regards,
Marcel

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

5 participants