I am trying to install tensorflow in R Studio through Linux terminal, by following the three methods mentioned in this link TensorFlow for R - Quick start, namely "auto", "virtualenv" and "conda". However, none of them worked.
Following the method "auto", we tried with the command:
tensorflow::install_tensorflow()
However, it gave an error related to the tensorflow version and I have tried with different versions of it:
> tensorflow::install_tensorflow()
Activated conda python: /root/.local/share/r-miniconda/envs/r-reticulate/bin/python
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
ERROR: Could not find a version that satisfies the requirement tensorflow==2.11.* (from versions: none)
ERROR: No matching distribution found for tensorflow==2.11.*
Error: Error installing package(s): "'tensorflow==2.11.*'"
Then, following the "virtualenv" method, it retrieved the same error as the "auto" technique:
> library(reticulate)
> virtualenv_create("r-reticulate", python = "/usr/bin/python3")
virtualenv: r-reticulate
> virtualenv_create("r-reticulate", python = "/usr/bin/python3")
virtualenv: r-reticulate
> library(tensorflow)
> install_tensorflow(envname = "r-reticulate")
Using virtual environment 'r-reticulate' ...
Collecting tensorflow==2.11.*
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Could not find a version that satisfies the requirement tensorflow==2.11.* (from versions: )
No matching distribution found for tensorflow==2.11.*
Error: Error installing package(s): "'tensorflow==2.11.*'"
Finally, I tried the "conda" alternative, conda_create("r-reticulate")
, but it gave the same error as trying with the "auto" method:
> install_tensorflow(envname = "r-reticulate")
Using virtual environment 'r-reticulate' ...
Collecting tensorflow==2.11.*
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/tensorflow/
Could not find a version that satisfies the requirement tensorflow==2.11.* (from versions: )
No matching distribution found for tensorflow==2.11.*
Error: Error installing package(s): "'tensorflow==2.11.*'"
Moreover, I tried following the steps on this link Tensorflow setup on RStudio/ R | CentOS but we could not install the tensorflow on the new port.
For your information, there are two Python versions installed in the Linux OS, which are 3.6.8 and 2.7.5. The R Studio version is 4.1.3.