Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Trying to install keras & tensorflow on an Amazon AWS Instance

$
0
0

I am running into some problems when trying to install keras and tensorflow on a Ubuntu EC2 Instance.

I load in the library and try to install keras.

library(keras)
library(tensorflow)
install_keras(tensorflow = "gpu")

I obtain the following error:

Error: could not find a Python environment for /usr/bin/python

I have also ran the following along with a few other terminal commands to try and install conda and python etc.

sudo apt install git libpython3.7-dev

I have also followed the keras.io website to try and install it. I have a folder on the server called /usr/bin/python3.6: however when I try to access it I get an error Directory /usr/bin/python3.6: no such file or directory. I have two user accounts at the home directory on the server (along with two folders by the same name) ubuntu and myUsername_folder.

In the /home/myUsername_folder I have the .rstudio files. (/home/myUsername_folder/.rstudio) and some datasets. In the home/ubuntu folder I have R installed /home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6. In the / root directory I have folders such as usr, var, lib64, tmp, bin etc.

How I can tell R where Python is located?

EDIT:

I restarted RStudio and ran:

> library(keras)
> library(tensorflow)
> install_keras(tensorflow = "gpu")
Using virtual environment '~/.virtualenvs/r-reticulate' ...
/home/myUser/.virtualenvs/r-reticulate/bin/python: No module named pip
Error in strsplit(output, "\\s+")[[1]] : subscript out of bounds
In addition: Warning message:
In system2(python, c("-m", "pip", "--version"), stdout = TRUE) :
  running command ''/home/myUser/.virtualenvs/r-reticulate/bin/python' -m pip --version' had status 1

Trying to install pip using:

sudo apt-get install python3-pip

Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.

Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>