0

I am new to keras and was trying to install keras and tensorflow in R on my computer running Windows 10 using this guide but get the error in the title:

install_keras()

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

All requested packages already installed.

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
Could not fetch URL https://pypi.org/simple/tensorflow/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/tensorflow/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement tensorflow==2.6.* (from versions: none)
ERROR: No matching distribution found for tensorflow==2.6.*
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Error: Error installing package(s): "\"tensorflow==2.6.*\"", "\"tensorflow-hub\"", "\"scipy\"", "\"requests\"", "\"Pillow\"", "\"h5py\"", "\"pandas\""

I tried installing OpenSSL due to this question and also tried copying dll's as described here, but nothing works.

Any suggestions?

Phil
  • 7,287
  • 3
  • 36
  • 66
MortenH
  • 11
  • 3

1 Answers1

0

So, I found a solution myself. I did:

library(reticulate)
install_miniconda(force = TRUE)

From the command prompt in Windows, I did:

conda activate r-reticulate
install keras

... and everything worked!

Seems to work now even though I do not activate the r-reticulate environment.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
MortenH
  • 11
  • 3