rstudio/keras3

GPU Installation Issue on Windows

Opened this issue · 3 comments

Hi,

Followed the installation instructions and to install keras3 with tensorflow in RStudio, however, it does not appear to have recognised my GPU.

install.packages("keras3")
keras3::install_keras(backend = "tensorflow", gpu = TRUE)

tensorflow::as_tensor("Hello World") # Installation good
tf$config$list_physical_devices('GPU') # But this returns an empty list

This is my first time trying to configure a GPU so I am a bit out of my depth, but here are my machine specs. Would really appreciate any help you can provide.

  • Windows 11
  • NVIDIA GeForce RTX 4080
  • Cuda 12.6.1 and cudnn 9.0 installed
  • WSL2 configured

Thanks and please let me know what other information I can provide to assist,
Harry

Thanks for opening.

To use a GPU with TensorFlow on Windows, you need to be running R/Python/TensorFlow in WSL. It sounds like you're running the windows-native R and RStudio builds, and not via WSL.

If you want to use RStudio with WSL, the easiest way is via the open-source RStudio Server. This article helps you get set up: https://support.posit.co/hc/en-us/articles/360049776974-Using-RStudio-Server-in-Windows-WSL2

Hi Tomasz,

Thanks for your help, really appreciate it. Followed those instructions but am now having trouble installing tensorflow into RStudio Server (using the code that you posted here: #1311).

Would really appreciate if you had a minute to look at the below diagnostic ouputs.

Thanks again,
Harry

> install.packages("remotes")
Installing package into ‘/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/remotes_2.5.0.tar.gz'
Content type 'application/x-gzip' length 164496 bytes (160 KB)
==================================================
downloaded 160 KB

* installing *source* package ‘remotes’ ...
** package ‘remotes’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (remotes)

The downloaded source packages are in
	‘/tmp/Rtmp9r6qrA/downloaded_packages’
> remotes::install_github(sprintf("rstudio/%s", c("reticulate", "tensorflow", "keras")))
Downloading GitHub repo rstudio/reticulate@HEAD
Running `R CMD build`...
* checking for file ‘/tmp/Rtmp9r6qrA/remotes66ba167474a7/rstudio-reticulate-65e17a3/DESCRIPTION’ ... OK
* preparing ‘reticulate’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘reticulate_1.39.0.9000.tar.gz’
Installing package into ‘/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
* installing *source* package ‘reticulate’ ...
** using staged installation
** libs
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c event_loop.cpp -o event_loop.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c libpython.cpp -o libpython.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c output.cpp -o output.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c pending_py_calls_notifier.cpp -o pending_py_calls_notifier.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c python.cpp -o python.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c readline.cpp -o readline.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-2y82rL/r-base-4.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c signals.cpp -o signals.o
g++ -std=gnu++17 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o reticulate.so RcppExports.o event_loop.o libpython.o output.o pending_py_calls_notifier.o python.o readline.o signals.o -L/usr/lib/R/lib -lR
installing to /home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/00LOCK-reticulate/00new/reticulate/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (reticulate)
Downloading GitHub repo rstudio/tensorflow@HEAD
Running `R CMD build`...
* checking for file ‘/tmp/Rtmp9r6qrA/remotes66ba259436e1/rstudio-tensorflow-4da7560/DESCRIPTION’ ... OK
* preparing ‘tensorflow’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘tensorflow_2.16.0.9000.tar.gz’
Installing package into ‘/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
* installing *source* package ‘tensorflow’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (tensorflow)
Downloading GitHub repo rstudio/keras@HEAD
Running `R CMD build`...
* checking for file ‘/tmp/Rtmp9r6qrA/remotes66baf2c3bf8/rstudio-keras3-6729243/DESCRIPTION’ ... OK
* preparing ‘keras3’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘keras3_1.2.0.9000.tar.gz’
Installing package into ‘/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
* installing *source* package ‘keras3’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (keras3)
> reticulate::miniconda_uninstall() # start with a blank slate
> reticulate::install_miniconda()
* Installing Miniconda -- please wait a moment ...
* Downloading 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh' ...
trying URL 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh'
Content type 'application/octet-stream' length 148337011 bytes (141.5 MB)
==================================================
downloaded 141.5 MB

+ /usr/bin/bash /tmp/Rtmp9r6qrA/Miniconda3-latest-Linux-x86_64.sh -b -u -p '/home/doc_wsl2/.local/share/r-miniconda'
PREFIX=/home/doc_wsl2/.local/share/r-miniconda
Unpacking payload ...

Installing base environment...

Preparing transaction: ...working... done
Executing transaction: ...working... done
installation finished.
+ /home/doc_wsl2/.local/share/r-miniconda/bin/conda update --yes --name base conda
Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

+ /home/doc_wsl2/.local/share/r-miniconda/bin/conda create --yes --name r-reticulate 'python=3.10' numpy --quiet -c conda-forge
Channels:
 - conda-forge
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /home/doc_wsl2/.local/share/r-miniconda/envs/r-reticulate

  added / updated specs:
    - numpy
    - python=3.10


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _libgcc_mutex-0.1          |      conda_forge           3 KB  conda-forge
    _openmp_mutex-4.5          |            2_gnu          23 KB  conda-forge
    bzip2-1.0.8                |       h4bc722e_7         247 KB  conda-forge
    ca-certificates-2024.8.30  |       hbcca054_0         155 KB  conda-forge
    ld_impl_linux-64-2.43      |       h712a8e2_2         654 KB  conda-forge
    libblas-3.9.0              |25_linux64_openblas          15 KB  conda-forge
    libcblas-3.9.0             |25_linux64_openblas          15 KB  conda-forge
    libffi-3.4.2               |       h7f98852_5          57 KB  conda-forge
    libgcc-14.2.0              |       h77fa898_1         829 KB  conda-forge
    libgcc-ng-14.2.0           |       h69a702a_1          53 KB  conda-forge
    libgfortran-14.2.0         |       h69a702a_1          53 KB  conda-forge
    libgfortran-ng-14.2.0      |       h69a702a_1          53 KB  conda-forge
    libgfortran5-14.2.0        |       hd5240d6_1         1.4 MB  conda-forge
    libgomp-14.2.0             |       h77fa898_1         450 KB  conda-forge
    liblapack-3.9.0            |25_linux64_openblas          15 KB  conda-forge
    libnsl-2.0.1               |       hd590300_0          33 KB  conda-forge
    libopenblas-0.3.28         |pthreads_h94d23a6_0         5.3 MB  conda-forge
    libsqlite-3.47.0           |       hadc24fc_0         854 KB  conda-forge
    libstdcxx-14.2.0           |       hc0a3c3a_1         3.7 MB  conda-forge
    libuuid-2.38.1             |       h0b41bf4_0          33 KB  conda-forge
    libxcrypt-4.4.36           |       hd590300_1          98 KB  conda-forge
    libzlib-1.3.1              |       hb9d3cd8_2          60 KB  conda-forge
    ncurses-6.5                |       he02047a_1         868 KB  conda-forge
    numpy-2.1.2                |  py310hd6e36ab_0         7.5 MB  conda-forge
    openssl-3.3.2              |       hb9d3cd8_0         2.8 MB  conda-forge
    pip-24.2                   |     pyh8b19718_1         1.2 MB  conda-forge
    python-3.10.15             |h4a871b0_2_cpython        24.1 MB  conda-forge
    python_abi-3.10            |          5_cp310           6 KB  conda-forge
    readline-8.2               |       h8228510_1         275 KB  conda-forge
    setuptools-75.1.0          |     pyhd8ed1ab_0         759 KB  conda-forge
    tk-8.6.13                  |noxft_h4845f30_101         3.2 MB  conda-forge
    tzdata-2024b               |       hc8b5060_0         119 KB  conda-forge
    wheel-0.44.0               |     pyhd8ed1ab_0          57 KB  conda-forge
    xz-5.2.6                   |       h166bdaf_0         409 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        55.3 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge 
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu 
  bzip2              conda-forge/linux-64::bzip2-1.0.8-h4bc722e_7 
  ca-certificates    conda-forge/linux-64::ca-certificates-2024.8.30-hbcca054_0 
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.43-h712a8e2_2 
  libblas            conda-forge/linux-64::libblas-3.9.0-25_linux64_openblas 
  libcblas           conda-forge/linux-64::libcblas-3.9.0-25_linux64_openblas 
  libffi             conda-forge/linux-64::libffi-3.4.2-h7f98852_5 
  libgcc             conda-forge/linux-64::libgcc-14.2.0-h77fa898_1 
  libgcc-ng          conda-forge/linux-64::libgcc-ng-14.2.0-h69a702a_1 
  libgfortran        conda-forge/linux-64::libgfortran-14.2.0-h69a702a_1 
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-14.2.0-h69a702a_1 
  libgfortran5       conda-forge/linux-64::libgfortran5-14.2.0-hd5240d6_1 
  libgomp            conda-forge/linux-64::libgomp-14.2.0-h77fa898_1 
  liblapack          conda-forge/linux-64::liblapack-3.9.0-25_linux64_openblas 
  libnsl             conda-forge/linux-64::libnsl-2.0.1-hd590300_0 
  libopenblas        conda-forge/linux-64::libopenblas-0.3.28-pthreads_h94d23a6_0 
  libsqlite          conda-forge/linux-64::libsqlite-3.47.0-hadc24fc_0 
  libstdcxx          conda-forge/linux-64::libstdcxx-14.2.0-hc0a3c3a_1 
  libuuid            conda-forge/linux-64::libuuid-2.38.1-h0b41bf4_0 
  libxcrypt          conda-forge/linux-64::libxcrypt-4.4.36-hd590300_1 
  libzlib            conda-forge/linux-64::libzlib-1.3.1-hb9d3cd8_2 
  ncurses            conda-forge/linux-64::ncurses-6.5-he02047a_1 
  numpy              conda-forge/linux-64::numpy-2.1.2-py310hd6e36ab_0 
  openssl            conda-forge/linux-64::openssl-3.3.2-hb9d3cd8_0 
  pip                conda-forge/noarch::pip-24.2-pyh8b19718_1 
  python             conda-forge/linux-64::python-3.10.15-h4a871b0_2_cpython 
  python_abi         conda-forge/linux-64::python_abi-3.10-5_cp310 
  readline           conda-forge/linux-64::readline-8.2-h8228510_1 
  setuptools         conda-forge/noarch::setuptools-75.1.0-pyhd8ed1ab_0 
  tk                 conda-forge/linux-64::tk-8.6.13-noxft_h4845f30_101 
  tzdata             conda-forge/noarch::tzdata-2024b-hc8b5060_0 
  wheel              conda-forge/noarch::wheel-0.44.0-pyhd8ed1ab_0 
  xz                 conda-forge/linux-64::xz-5.2.6-h166bdaf_0 


Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
* Miniconda has been successfully installed at "~/.local/share/r-miniconda".
[1] "/home/doc_wsl2/.local/share/r-miniconda"
> keras::install_keras()
sh: 1: nvidia-smi: not found
Virtual environment 'r-tensorflow' removed.
Using Python: /home/doc_wsl2/.pyenv/versions/3.10.15/bin/python3.10
Creating virtual environment 'r-tensorflow' ... 
+ /home/doc_wsl2/.pyenv/versions/3.10.15/bin/python3.10 -m venv /home/doc_wsl2/.virtualenvs/r-tensorflow
Done!
Installing packages: pip, wheel, setuptools
+ /home/doc_wsl2/.virtualenvs/r-tensorflow/bin/python -m pip install --upgrade pip wheel setuptools
Requirement already satisfied: pip in ./.virtualenvs/r-tensorflow/lib/python3.10/site-packages (23.0.1)
Collecting pip
  Using cached pip-24.3.1-py3-none-any.whl (1.8 MB)
Collecting wheel
  Using cached wheel-0.44.0-py3-none-any.whl (67 kB)
Requirement already satisfied: setuptools in ./.virtualenvs/r-tensorflow/lib/python3.10/site-packages (65.5.0)
Collecting setuptools
  Using cached setuptools-75.2.0-py3-none-any.whl (1.2 MB)
Installing collected packages: wheel, setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 65.5.0
    Uninstalling setuptools-65.5.0:
      Successfully uninstalled setuptools-65.5.0
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-24.3.1 setuptools-75.2.0 wheel-0.44.0
Virtual environment 'r-tensorflow' successfully created.
Using virtual environment 'r-tensorflow' ...
+ /home/doc_wsl2/.virtualenvs/r-tensorflow/bin/python -m pip install --upgrade --no-user 'numpy<2' 'tensorflow==2.15.*' tensorflow-hub tensorflow-datasets scipy requests Pillow h5py pandas pydot
Collecting numpy<2
  Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
Collecting tensorflow==2.15.*
  Using cached tensorflow-2.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB)
Collecting tensorflow-hub
  Using cached tensorflow_hub-0.16.1-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting tensorflow-datasets
  Using cached tensorflow_datasets-4.9.6-py3-none-any.whl.metadata (9.5 kB)
Collecting scipy
  Using cached scipy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Collecting requests
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting Pillow
  Using cached pillow-11.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (9.1 kB)
Collecting h5py
  Using cached h5py-3.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.5 kB)
Collecting pandas
  Using cached pandas-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (89 kB)
Collecting pydot
  Using cached pydot-3.0.2-py3-none-any.whl.metadata (10 kB)
Collecting absl-py>=1.0.0 (from tensorflow==2.15.*)
  Using cached absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting astunparse>=1.6.0 (from tensorflow==2.15.*)
  Using cached astunparse-1.6.3-py2.py3-none-any.whl.metadata (4.4 kB)
Collecting flatbuffers>=23.5.26 (from tensorflow==2.15.*)
  Using cached flatbuffers-24.3.25-py2.py3-none-any.whl.metadata (850 bytes)
Collecting gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 (from tensorflow==2.15.*)
  Using cached gast-0.6.0-py3-none-any.whl.metadata (1.3 kB)
Collecting google-pasta>=0.1.1 (from tensorflow==2.15.*)
  Using cached google_pasta-0.2.0-py3-none-any.whl.metadata (814 bytes)
Collecting libclang>=13.0.0 (from tensorflow==2.15.*)
  Using cached libclang-18.1.1-py2.py3-none-manylinux2010_x86_64.whl.metadata (5.2 kB)
Collecting ml-dtypes~=0.3.1 (from tensorflow==2.15.*)
  Using cached ml_dtypes-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (20 kB)
Collecting opt-einsum>=2.3.2 (from tensorflow==2.15.*)
  Using cached opt_einsum-3.4.0-py3-none-any.whl.metadata (6.3 kB)
Collecting packaging (from tensorflow==2.15.*)
  Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 (from tensorflow==2.15.*)
  Using cached protobuf-4.25.5-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes)
Requirement already satisfied: setuptools in ./.virtualenvs/r-tensorflow/lib/python3.10/site-packages (from tensorflow==2.15.*) (75.2.0)
Collecting six>=1.12.0 (from tensorflow==2.15.*)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting termcolor>=1.1.0 (from tensorflow==2.15.*)
  Using cached termcolor-2.5.0-py3-none-any.whl.metadata (6.1 kB)
Collecting typing-extensions>=3.6.6 (from tensorflow==2.15.*)
  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting wrapt<1.15,>=1.11.0 (from tensorflow==2.15.*)
  Using cached wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow==2.15.*)
  Using cached tensorflow_io_gcs_filesystem-0.37.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (14 kB)
Collecting grpcio<2.0,>=1.24.3 (from tensorflow==2.15.*)
  Using cached grpcio-1.67.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.9 kB)
Collecting tensorboard<2.16,>=2.15 (from tensorflow==2.15.*)
  Using cached tensorboard-2.15.2-py3-none-any.whl.metadata (1.7 kB)
Collecting tensorflow-estimator<2.16,>=2.15.0 (from tensorflow==2.15.*)
  Using cached tensorflow_estimator-2.15.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting keras<2.16,>=2.15.0 (from tensorflow==2.15.*)
  Using cached keras-2.15.0-py3-none-any.whl.metadata (2.4 kB)
Collecting tf-keras>=2.14.1 (from tensorflow-hub)
  Using cached tf_keras-2.18.0-py3-none-any.whl.metadata (1.6 kB)
Collecting click (from tensorflow-datasets)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting dm-tree (from tensorflow-datasets)
  Using cached dm_tree-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.9 kB)
Collecting immutabledict (from tensorflow-datasets)
  Using cached immutabledict-4.2.0-py3-none-any.whl.metadata (3.4 kB)
Collecting promise (from tensorflow-datasets)
  Using cached promise-2.3-py3-none-any.whl
Collecting psutil (from tensorflow-datasets)
  Using cached psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (22 kB)
Collecting pyarrow (from tensorflow-datasets)
  Using cached pyarrow-17.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (3.3 kB)
Collecting simple-parsing (from tensorflow-datasets)
  Using cached simple_parsing-0.1.6-py3-none-any.whl.metadata (7.3 kB)
Collecting tensorflow-metadata (from tensorflow-datasets)
  Using cached tensorflow_metadata-1.16.1-py3-none-any.whl.metadata (2.4 kB)
Collecting toml (from tensorflow-datasets)
  Using cached toml-0.10.2-py2.py3-none-any.whl.metadata (7.1 kB)
Collecting tqdm (from tensorflow-datasets)
  Using cached tqdm-4.66.5-py3-none-any.whl.metadata (57 kB)
Collecting array-record>=0.5.0 (from tensorflow-datasets)
  Using cached array_record-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (699 bytes)
Collecting etils>=1.6.0 (from etils[enp,epath,epy,etree]>=1.6.0; python_version < "3.11"->tensorflow-datasets)
  Using cached etils-1.10.0-py3-none-any.whl.metadata (6.5 kB)
Collecting charset-normalizer<4,>=2 (from requests)
  Using cached charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (34 kB)
Collecting idna<4,>=2.5 (from requests)
  Using cached idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests)
  Using cached urllib3-2.2.3-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests)
  Using cached certifi-2024.8.30-py3-none-any.whl.metadata (2.2 kB)
Collecting python-dateutil>=2.8.2 (from pandas)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas)
  Using cached pytz-2024.2-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas)
  Using cached tzdata-2024.2-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting pyparsing>=3.0.9 (from pydot)
  Using cached pyparsing-3.2.0-py3-none-any.whl.metadata (5.0 kB)
Requirement already satisfied: wheel<1.0,>=0.23.0 in ./.virtualenvs/r-tensorflow/lib/python3.10/site-packages (from astunparse>=1.6.0->tensorflow==2.15.*) (0.44.0)
Collecting fsspec (from etils[enp,epath,epy,etree]>=1.6.0; python_version < "3.11"->tensorflow-datasets)
  Using cached fsspec-2024.10.0-py3-none-any.whl.metadata (11 kB)
Collecting importlib_resources (from etils[enp,epath,epy,etree]>=1.6.0; python_version < "3.11"->tensorflow-datasets)
  Using cached importlib_resources-6.4.5-py3-none-any.whl.metadata (4.0 kB)
Collecting zipp (from etils[enp,epath,epy,etree]>=1.6.0; python_version < "3.11"->tensorflow-datasets)
  Using cached zipp-3.20.2-py3-none-any.whl.metadata (3.7 kB)
Collecting google-auth<3,>=1.6.3 (from tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached google_auth-2.35.0-py2.py3-none-any.whl.metadata (4.7 kB)
Collecting google-auth-oauthlib<2,>=0.5 (from tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached google_auth_oauthlib-1.2.1-py2.py3-none-any.whl.metadata (2.7 kB)
Collecting markdown>=2.6.8 (from tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached Markdown-3.7-py3-none-any.whl.metadata (7.0 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl.metadata (1.1 kB)
Collecting werkzeug>=1.0.1 (from tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached werkzeug-3.0.6-py3-none-any.whl.metadata (3.7 kB)
INFO: pip is looking at multiple versions of tf-keras to determine which version is compatible with other requirements. This could take a while.
Collecting tf-keras>=2.14.1 (from tensorflow-hub)
  Using cached tf_keras-2.17.0-py3-none-any.whl.metadata (1.6 kB)
  Using cached tf_keras-2.16.0-py3-none-any.whl.metadata (1.6 kB)
  Using cached tf_keras-2.15.1-py3-none-any.whl.metadata (1.7 kB)
Collecting docstring-parser<1.0,>=0.15 (from simple-parsing->tensorflow-datasets)
  Using cached docstring_parser-0.16-py3-none-any.whl.metadata (3.0 kB)
Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 (from tensorflow==2.15.*)
  Using cached protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.metadata (679 bytes)
Collecting cachetools<6.0,>=2.0.0 (from google-auth<3,>=1.6.3->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached cachetools-5.5.0-py3-none-any.whl.metadata (5.3 kB)
Collecting pyasn1-modules>=0.2.1 (from google-auth<3,>=1.6.3->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached pyasn1_modules-0.4.1-py3-none-any.whl.metadata (3.5 kB)
Collecting rsa<5,>=3.1.4 (from google-auth<3,>=1.6.3->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached rsa-4.9-py3-none-any.whl.metadata (4.2 kB)
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<2,>=0.5->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached requests_oauthlib-2.0.0-py2.py3-none-any.whl.metadata (11 kB)
Collecting MarkupSafe>=2.1.1 (from werkzeug>=1.0.1->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB)
Collecting pyasn1<0.7.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached pyasn1-0.6.1-py3-none-any.whl.metadata (8.4 kB)
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<2,>=0.5->tensorboard<2.16,>=2.15->tensorflow==2.15.*)
  Using cached oauthlib-3.2.2-py3-none-any.whl.metadata (7.5 kB)
Using cached tensorflow-2.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (475.2 MB)
Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
Using cached tensorflow_hub-0.16.1-py2.py3-none-any.whl (30 kB)
Using cached tensorflow_datasets-4.9.6-py3-none-any.whl (5.1 MB)
Using cached scipy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (41.2 MB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached pillow-11.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (4.4 MB)
Using cached h5py-3.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB)
Using cached pandas-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.1 MB)
Using cached pydot-3.0.2-py3-none-any.whl (35 kB)
Using cached absl_py-2.1.0-py3-none-any.whl (133 kB)
Using cached array_record-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB)
Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Using cached certifi-2024.8.30-py3-none-any.whl (167 kB)
Using cached charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (144 kB)
Using cached etils-1.10.0-py3-none-any.whl (164 kB)
Using cached flatbuffers-24.3.25-py2.py3-none-any.whl (26 kB)
Using cached gast-0.6.0-py3-none-any.whl (21 kB)
Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Using cached grpcio-1.67.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB)
Using cached idna-3.10-py3-none-any.whl (70 kB)
Using cached keras-2.15.0-py3-none-any.whl (1.7 MB)
Using cached libclang-18.1.1-py2.py3-none-manylinux2010_x86_64.whl (24.5 MB)
Using cached ml_dtypes-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB)
Using cached opt_einsum-3.4.0-py3-none-any.whl (71 kB)
Using cached pyparsing-3.2.0-py3-none-any.whl (106 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.2-py2.py3-none-any.whl (508 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached tensorboard-2.15.2-py3-none-any.whl (5.5 MB)
Using cached tensorflow_estimator-2.15.0-py2.py3-none-any.whl (441 kB)
Using cached tensorflow_io_gcs_filesystem-0.37.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB)
Using cached termcolor-2.5.0-py3-none-any.whl (7.8 kB)
Using cached tf_keras-2.15.1-py3-none-any.whl (1.7 MB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Using cached tzdata-2024.2-py2.py3-none-any.whl (346 kB)
Using cached urllib3-2.2.3-py3-none-any.whl (126 kB)
Using cached wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached dm_tree-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (152 kB)
Using cached immutabledict-4.2.0-py3-none-any.whl (4.7 kB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Using cached psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (287 kB)
Using cached pyarrow-17.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (39.9 MB)
Using cached simple_parsing-0.1.6-py3-none-any.whl (112 kB)
Using cached tensorflow_metadata-1.16.1-py3-none-any.whl (28 kB)
Using cached protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Using cached tqdm-4.66.5-py3-none-any.whl (78 kB)
Using cached docstring_parser-0.16-py3-none-any.whl (36 kB)
Using cached google_auth-2.35.0-py2.py3-none-any.whl (208 kB)
Using cached google_auth_oauthlib-1.2.1-py2.py3-none-any.whl (24 kB)
Using cached Markdown-3.7-py3-none-any.whl (106 kB)
Using cached tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl (6.6 MB)
Using cached werkzeug-3.0.6-py3-none-any.whl (227 kB)
Using cached fsspec-2024.10.0-py3-none-any.whl (179 kB)
Using cached importlib_resources-6.4.5-py3-none-any.whl (36 kB)
Using cached zipp-3.20.2-py3-none-any.whl (9.2 kB)
Using cached cachetools-5.5.0-py3-none-any.whl (9.5 kB)
Using cached MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20 kB)
Using cached pyasn1_modules-0.4.1-py3-none-any.whl (181 kB)
Using cached requests_oauthlib-2.0.0-py2.py3-none-any.whl (24 kB)
Using cached rsa-4.9-py3-none-any.whl (34 kB)
Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
Using cached pyasn1-0.6.1-py3-none-any.whl (83 kB)
Installing collected packages: pytz, libclang, flatbuffers, dm-tree, zipp, wrapt, urllib3, tzdata, typing-extensions, tqdm, toml, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard-data-server, six, pyparsing, pyasn1, psutil, protobuf, Pillow, packaging, opt-einsum, oauthlib, numpy, MarkupSafe, markdown, keras, importlib_resources, immutabledict, idna, grpcio, gast, fsspec, etils, docstring-parser, click, charset-normalizer, certifi, cachetools, absl-py, werkzeug, tensorflow-metadata, simple-parsing, scipy, rsa, requests, python-dateutil, pydot, pyasn1-modules, pyarrow, promise, ml-dtypes, h5py, google-pasta, astunparse, requests-oauthlib, pandas, google-auth, google-auth-oauthlib, array-record, tensorboard, tensorflow-datasets, tensorflow, tf-keras, tensorflow-hub
Successfully installed MarkupSafe-3.0.2 Pillow-11.0.0 absl-py-2.1.0 array-record-0.5.1 astunparse-1.6.3 cachetools-5.5.0 certifi-2024.8.30 charset-normalizer-3.4.0 click-8.1.7 dm-tree-0.1.8 docstring-parser-0.16 etils-1.10.0 flatbuffers-24.3.25 fsspec-2024.10.0 gast-0.6.0 google-auth-2.35.0 google-auth-oauthlib-1.2.1 google-pasta-0.2.0 grpcio-1.67.0 h5py-3.12.1 idna-3.10 immutabledict-4.2.0 importlib_resources-6.4.5 keras-2.15.0 libclang-18.1.1 markdown-3.7 ml-dtypes-0.3.2 numpy-1.26.4 oauthlib-3.2.2 opt-einsum-3.4.0 packaging-24.1 pandas-2.2.3 promise-2.3 protobuf-3.20.3 psutil-6.1.0 pyarrow-17.0.0 pyasn1-0.6.1 pyasn1-modules-0.4.1 pydot-3.0.2 pyparsing-3.2.0 python-dateutil-2.9.0.post0 pytz-2024.2 requests-2.32.3 requests-oauthlib-2.0.0 rsa-4.9 scipy-1.14.1 simple-parsing-0.1.6 six-1.16.0 tensorboard-2.15.2 tensorboard-data-server-0.7.2 tensorflow-2.15.1 tensorflow-datasets-4.9.6 tensorflow-estimator-2.15.0 tensorflow-hub-0.16.1 tensorflow-io-gcs-filesystem-0.37.1 tensorflow-metadata-1.16.1 termcolor-2.5.0 tf-keras-2.15.1 toml-0.10.2 tqdm-4.66.5 typing-extensions-4.12.2 tzdata-2024.2 urllib3-2.2.3 werkzeug-3.0.6 wrapt-1.14.1 zipp-3.20.2

Installation complete.


Restarting R session...

> tensorflow::as_tensor("Hello World")
Error: Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 /home/doc_wsl2/.pyenv/versions/3.10.15/bin/python3.10

Python exception encountered:
 Traceback (most recent call last):
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/__init__.py", line 48, in <module>
    from tensorflow._api.v2 import __internal__
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _r
> reticulate::py_config()
python:         /home/doc_wsl2/.virtualenvs/r-tensorflow/bin/python
libpython:      /home/doc_wsl2/.pyenv/versions/3.10.15/lib/libpython3.10.so
pythonhome:     /home/doc_wsl2/.virtualenvs/r-tensorflow:/home/doc_wsl2/.virtualenvs/r-tensorflow
version:        3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]
numpy:          /home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/numpy
numpy_version:  1.26.4
tensorflow:     /home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow

NOTE: Python version was forced by import("tensorflow")
> tensorflow::tf_config()
Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 /home/doc_wsl2/.pyenv/versions/3.10.15/bin/python3.10

Python exception encountered:
 Traceback (most recent call last):
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/__init__.py", line 48, in <module>
    from tensorflow._api.v2 import __internal__
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/_api/v2/__internal__/__init__.py", line 8, in <module>
    from tensorflow._api.v2.__internal__ import autograph
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/_api/v2/__internal__/autograph/__init__.py", line 8, in <module>
    from tensorflow.python.autograph.core.ag_ctx import control_status_ctx # line: 34
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/autograph/core/ag_ctx.py", line 21, in <module>
    from tensorflow.python.autograph.utils import ag_logging
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/autograph/utils/__init__.py", line 17, in <module>
    from tensorflow.python.autograph.utils.context_managers import control_dependency_on_returns
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/autograph/utils/context_managers.py", line 19, in <module>
    from tensorflow.python.framework import ops
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/framework/ops.py", line 40, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/pywrap_tensorflow.py", line 17, in <module>
    import ctypes
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/doc_wsl2/.pyenv/versions/3.10.15/lib/python3.10/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/doc_wsl2/R/x86_64-pc-linux-gnu-library/4.4/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
ModuleNotFoundError: No module named '_ctypes'


You can install TensorFlow using the install_tensorflow() function.
 
> reticulate::import("tensorflow")
Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named '_ctypes'
Run `reticulate::py_last_error()` for details.

Hi,

reticulate::install_miniconda()

Please avoid using miniconda. Instead, use reticulate::install_python().

libpython: /home/doc_wsl2/.pyenv/versions/3.10.15/lib/libpython3.10.so

This shows that you're not using miniconda but the pyenv-installed Python from install_python(), so running reticulate::install_miniconda() was unnecessary.

ModuleNotFoundError: No module named '_ctypes'

This error suggests the Python installation is incomplete, likely due to missing system dependencies. Check the details in ?reticulate::install_python online link. Specifically, the man page links to the pyenv wiki, which provides instructions for installing system dependencies. For example, on Ubuntu, you can run the following in bash:

sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Afterward, you'll likely need to remove the previous Python installation and force a rebuild by calling install_python() again in R. Watch for any errors during the build process.

unlink("~/.pyenv", recursive = TRUE, force = TRUE)
reticulate::install_python("3.11", force = TRUE)