0

I'm trying to install Keras by following the instructions here https://keras.rstudio.com/ when I'm using my office/work laptop.

When I get to this line install_keras() and it fails with this rather long error message shown here in its entirety:

Creating r-tensorflow conda environment for TensorFlow installation...
Fetching package metadata ...
CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
<https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on 
your way.
ProxyError(MaxRetryError("HTTPSConnectionPool(host='repo.continuum.io', 
port=443): Max retries exceeded with url: /pkgs/main/win-6     
/repodata.json.bz2 (Caused by ProxyError('Cannot connect to proxy.', 
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 
0x000001ACD38FB780>: Failed to establish a new connection: [Errno 11001] 
getaddrinfo failed',)))",),)

Error: Error 1 occurred creating conda environment r-tensorflow
In addition: Warning message:
running command '"C:\PROGRA~3\ANACON~1\Scripts\conda.exe" "create" "--
yes"   "--name" "r-tensorflow" "python=3.6"' had status 1 

and it says something about Anaconda. So I dutifully install the entire Anaconda beast from this Anaconda distribution.

Now when I try install_keras() I get this new error message about a proxy:

Using r-tensorflow conda environment for TensorFlow installation
Determining latest release of TensorFlow...Error in 
open.connection(con, "rb") : 
Unsupported proxy 'https://proxy-server.mycompanyname.com:8080', libcurl   
is built without the HTTPS-proxy support.

I reviewed Jeroen's libcurl suggestion which yields the following responses:

curl::ie_proxy_info()

$AutoDetect
[1] FALSE

$AutoConfigUrl
[1] "http://mcd-server/mcd/proxy.pac"

$Proxy
NULL

$ProxyBypass
NULL

and this

curl::ie_get_proxy_for_url()
[1] "proxy-server:8080"

So I seem to have a good connection to the internet through RStudio but not when using Anaconda's software.

I have verified that I have a good internet connection using this:

httr::BROWSE("https://www.ibm.com")

It appears that libcurl is built without HTTPS-proxy support, apparently.

Any suggestions?

Community
  • 1
  • 1
hackR
  • 1,459
  • 17
  • 26

1 Answers1

2

SOLVED!

1) Step 1: allow Anaconda to access the internet by adding proxy info with a new file named .condarc exactly as detailed in this answer. You can verify this works ok by typing conda update conda into the Anaconda Prompt app.

2) Step 2: allow R and RStudio to access the internet by adding these 2 lines into the .Renviron file (in my case this was found in C:\Users\USERNAME\Documents for Windows 10):

http_proxy=http://proxy-server:8080
https_proxy=http://proxy-server:8080

You can now run this to install Keras:

library(keras)
install_keras()
hackR
  • 1,459
  • 17
  • 26