Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to install tensorflow/rstudio on ubuntu 22.04 running on #603

Closed
netyasap opened this issue Aug 14, 2024 · 6 comments
Closed

unable to install tensorflow/rstudio on ubuntu 22.04 running on #603

netyasap opened this issue Aug 14, 2024 · 6 comments

Comments

@netyasap
Copy link

I recently built myself a workstation to do some DL prototyping but following the instructions from the Deep Learning with R 2nd edition and trying various snippets of code, I always get the same error, where it looks like there's some issue with the python installation. After having tried many different ways, very clear that I just need some help. I have not yet installed CUDA cuDNN per the directions in the book, as my understanding was that I needed to install tensorflow first, see what version it is and then get the appropriate versions of CUDA and cuDNN.

Following the instructions in the book (or even otherwise), this is the message I get

creating symlinks:

  • -> '../nvidia/cublas/lib/libcublasLt.so.12'
  • -> '../nvidia/cublas/lib/libcublas.so.12'
  • -> '../nvidia/cublas/lib/libnvblas.so.12'
  • -> '../nvidia/cuda_cupti/lib/libcheckpoint.so'
  • -> '../nvidia/cuda_cupti/lib/libcupti.so.12'
  • -> '../nvidia/cuda_cupti/lib/libnvperf_host.so'
  • -> '../nvidia/cuda_cupti/lib/libnvperf_target.so'
  • -> '../nvidia/cuda_cupti/lib/libpcsamplingutil.so'
  • -> '../nvidia/cuda_nvrtc/lib/libnvrtc-builtins.so.12.2'
  • -> '../nvidia/cuda_nvrtc/lib/libnvrtc.so.12'
  • -> '../nvidia/cuda_runtime/lib/libcudart.so.12'
  • -> '../nvidia/cudnn/lib/libcudnn_adv_infer.so.8'
  • -> '../nvidia/cudnn/lib/libcudnn_adv_train.so.8'
  • -> '../nvidia/cudnn/lib/libcudnn_cnn_infer.so.8'
  • -> '../nvidia/cudnn/lib/libcudnn_cnn_train.so.8'
  • -> '../nvidia/cudnn/lib/libcudnn_ops_infer.so.8'
  • -> '../nvidia/cudnn/lib/libcudnn_ops_train.so.8'
  • -> '../nvidia/cudnn/lib/libcudnn.so.8'
  • -> '../nvidia/cufft/lib/libcufft.so.11'
  • -> '../nvidia/cufft/lib/libcufftw.so.11'
  • -> '../nvidia/curand/lib/libcurand.so.10'
  • -> '../nvidia/cusolver/lib/libcusolverMg.so.11'
  • -> '../nvidia/cusolver/lib/libcusolver.so.11'
  • -> '../nvidia/cusparse/lib/libcusparse.so.12'
  • -> '../nvidia/nccl/lib/libnccl.so.2'
  • -> '../nvidia/nvjitlink/lib/libnvJitLink.so.12'
    Error in file.symlink(from = from, to = to) :
    no files/directory to link to

I get this same error regardless of how I install (including using install_tensorflow() and the remotes code that I have found on Github). Help!

@t-kalinowski
Copy link
Member

Hi, congrats on the new machine!

Can you please fill out the installation issue template? https://github.com/rstudio/tensorflow/blob/main/.github/ISSUE_TEMPLATE/installation-issue.md

@netyasap
Copy link
Author

netyasap commented Aug 14, 2024


name: Installation Issue
about: Trouble installing Tensorflow
title: Installation Issue
labels: 'Installation'
assignees: ''

Many installation issues are resolved by running the following in a fresh R session (you can restart R in Rstudio with Ctrl+Shift+F10) :

# install the development version of packages, in case the
# issue is already fixed but not on CRAN yet.
install.packages("pak")
pak::pak(sprintf("rstudio/%s", c("reticulate", "tensorflow", "keras")))
if (is.null(reticulate::virtualenv_starter()))
   reticulate::install_python()
tensorflow::install_tensorflow()

Test to see if installation was successful.

tensorflow::as_tensor("Hello World")

If the above snippet succeeded and you saw something like tf.Tensor(b'Hello World', shape=(), dtype=string), then 🎉, you've successfully installed Tensorflow.

If the above installation failed, please gather some diagnostic info:

reticulate::py_config()
tensorflow::tf_config()
reticulate::import("tensorflow")
reticulate::py_last_error()
sessionInfo()

Please copy and paste the FULL OUTPUT of running all three snippets, and be sure to enclose the output lines with three backticks (```) for monospace formatting.

Tried to install using the first code snippet above, but got the following output - which was a problem with libcurl while installing pak. Checked and the location of pkg-config, etc... is in my PATH, so not sure what's going on here.

Installing package into ‘/home/-------/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/pak_0.7.2.tar.gz'
Content type 'application/x-gzip' length 2027490 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** Running ./configure
** libs
Current platform: x86_64-pc-linux-gnu 
Build platform:   
Target platform:   

Compiling R6 

Compiling cli 
make[1]: Entering directory '/tmp/Rtmp1YYMOm/R.INSTALL4ff514e8def9/pak/src/library/cli/src'
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ansi.c -o ansi.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c cleancall.c -o cleancall.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c diff.c -o diff.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c errors.c -o errors.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c glue.c -o glue.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c inst.c -o inst.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c keypress-unix.c -o keypress-unix.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c keypress-win.c -o keypress-win.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c keypress.c -o keypress.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c md5.c -o md5.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c progress-altrep.c -o progress-altrep.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c progress.c -o progress.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c sha1.c -o sha1.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c sha256.c -o sha256.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c thread.c -o thread.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tty.c -o tty.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8.c -o utf8.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c vt.c -o vt.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c vtparse.c -o vtparse.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c vtparse_table.c -o vtparse_table.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c win-utf8.c -o win-utf8.o
gcc -I"/usr/share/R/include" -DNDEBUG     -fvisibility=hidden -I../inst/include -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c winfiles.c -o winfiles.o
gcc -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o cli.so ansi.o cleancall.o diff.o errors.o glue.o init.o inst.o keypress-unix.o keypress-win.o keypress.o md5.o progress-altrep.o progress.o sha1.o sha256.o thread.o tty.o utf8.o utils.o vt.o vtparse.o vtparse_table.o win-utf8.o winfiles.o -L/usr/lib/R/lib -lR
make[1]: Leaving directory '/tmp/Rtmp1YYMOm/R.INSTALL4ff514e8def9/pak/src/library/cli/src'
installing to /home/------/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-pak/00new/pak/library/cli/libs

Compiling curl 
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
--------------------------- [ANTICONF] --------------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: curl/curl.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
Error in install_one(pkg, lib = lib) : FAILED
Calls: install_embedded_main -> install_all -> install_one
Execution halted
installing via 'install.libs.R' to /home/------/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-pak/00new/pak
Error in eval(ei, envir) : Compilation failed.
* removing ‘/home/------/R/x86_64-pc-linux-gnu-library/4.1/pak’
Warning in install.packages :
  installation of package ‘pak’ had non-zero exit status

@netyasap netyasap reopened this Aug 14, 2024
@netyasap
Copy link
Author

netyasap commented Aug 16, 2024

Was wrong about installation of libcurl4-openssl-dev. Did install, but I still get the same end result. Starting from the install_tensorflow() command:

✔ All system requirements are already installed.
  
ℹ No downloads are needed
✔ 3 pkgs + 31 deps: kept 32 [4.9s]
> if (is.null(reticulate::virtualenv_starter()))
+     reticulate::install_python()
> tensorflow::install_tensorflow()
Using Python: /home/-----/.pyenv/versions/3.10.14/bin/python3.10
Creating virtual environment 'r-tensorflow' ... 
+ /home/-----/.pyenv/versions/3.10.14/bin/python3.10 -m venv /home/-----/.virtualenvs/r-tensorflow
Done!
Installing packages: pip, wheel, setuptools
+ /home/-----/.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.2-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-72.2.0-py3-none-any.whl (2.3 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.2 setuptools-72.2.0 wheel-0.44.0
Virtual environment 'r-tensorflow' successfully created.
Using virtual environment 'r-tensorflow' ...
+ /home/-----/.virtualenvs/r-tensorflow/bin/python -m pip install --upgrade --no-user 'tensorflow[and-cuda]==2.16.*'
Collecting tensorflow==2.16.* (from tensorflow[and-cuda]==2.16.*)
  Using cached tensorflow-2.16.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB)
Collecting absl-py>=1.0.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting astunparse>=1.6.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached astunparse-1.6.3-py2.py3-none-any.whl.metadata (4.4 kB)
Collecting flatbuffers>=23.5.26 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  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.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached gast-0.6.0-py3-none-any.whl.metadata (1.3 kB)
Collecting google-pasta>=0.1.1 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached google_pasta-0.2.0-py3-none-any.whl.metadata (814 bytes)
Collecting h5py>=3.10.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached h5py-3.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.5 kB)
Collecting libclang>=13.0.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  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.16.*->tensorflow[and-cuda]==2.16.*)
  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.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached opt_einsum-3.3.0-py3-none-any.whl.metadata (6.5 kB)
Collecting packaging (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  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.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached protobuf-4.25.4-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes)
Collecting requests<3,>=2.21.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Requirement already satisfied: setuptools in ./.virtualenvs/r-tensorflow/lib/python3.10/site-packages (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*) (72.2.0)
Collecting six>=1.12.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting termcolor>=1.1.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB)
Collecting typing-extensions>=3.6.6 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting wrapt>=1.11.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
Collecting grpcio<2.0,>=1.24.3 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached grpcio-1.65.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.3 kB)
Collecting tensorboard<2.17,>=2.16 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached tensorboard-2.16.2-py3-none-any.whl.metadata (1.6 kB)
Collecting keras>=3.0.0 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached keras-3.5.0-py3-none-any.whl.metadata (5.8 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached tensorflow_io_gcs_filesystem-0.37.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (14 kB)
Collecting numpy<2.0.0,>=1.23.5 (from tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
Collecting nvidia-cublas-cu12==12.3.4.1 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cublas_cu12-12.3.4.1-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)
Collecting nvidia-cuda-cupti-cu12==12.3.101 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cuda_cupti_cu12-12.3.101-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)
Collecting nvidia-cuda-nvcc-cu12==12.3.107 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cuda_nvcc_cu12-12.3.107-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)
Collecting nvidia-cuda-nvrtc-cu12==12.3.107 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cuda_nvrtc_cu12-12.3.107-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)
Collecting nvidia-cuda-runtime-cu12==12.3.101 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cuda_runtime_cu12-12.3.101-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)
Collecting nvidia-cudnn-cu12==8.9.7.29 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cudnn_cu12-8.9.7.29-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)
Collecting nvidia-cufft-cu12==11.0.12.1 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cufft_cu12-11.0.12.1-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)
Collecting nvidia-curand-cu12==10.3.4.107 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_curand_cu12-10.3.4.107-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)
Collecting nvidia-cusolver-cu12==11.5.4.101 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cusolver_cu12-11.5.4.101-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)
Collecting nvidia-cusparse-cu12==12.2.0.103 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_cusparse_cu12-12.2.0.103-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)
Collecting nvidia-nccl-cu12==2.19.3 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl.metadata (1.8 kB)
Collecting nvidia-nvjitlink-cu12==12.3.101 (from tensorflow[and-cuda]==2.16.*)
  Using cached nvidia_nvjitlink_cu12-12.3.101-py3-none-manylinux1_x86_64.whl.metadata (1.5 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.16.*->tensorflow[and-cuda]==2.16.*) (0.44.0)
Collecting rich (from keras>=3.0.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached rich-13.7.1-py3-none-any.whl.metadata (18 kB)
Collecting namex (from keras>=3.0.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached namex-0.0.8-py3-none-any.whl.metadata (246 bytes)
Collecting optree (from keras>=3.0.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached optree-0.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (47 kB)
Collecting charset-normalizer<4,>=2 (from requests<3,>=2.21.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests<3,>=2.21.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests<3,>=2.21.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests<3,>=2.21.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached certifi-2024.7.4-py3-none-any.whl.metadata (2.2 kB)
Collecting markdown>=2.6.8 (from tensorboard<2.17,>=2.16->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached Markdown-3.6-py3-none-any.whl.metadata (7.0 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard<2.17,>=2.16->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  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.17,>=2.16->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached werkzeug-3.0.3-py3-none-any.whl.metadata (3.7 kB)
Collecting MarkupSafe>=2.1.1 (from werkzeug>=1.0.1->tensorboard<2.17,>=2.16->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Collecting markdown-it-py>=2.2.0 (from rich->keras>=3.0.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich->keras>=3.0.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached pygments-2.18.0-py3-none-any.whl.metadata (2.5 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich->keras>=3.0.0->tensorflow==2.16.*->tensorflow[and-cuda]==2.16.*)
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Using cached tensorflow-2.16.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (590.6 MB)
Using cached nvidia_cublas_cu12-12.3.4.1-py3-none-manylinux1_x86_64.whl (412.6 MB)
Using cached nvidia_cuda_cupti_cu12-12.3.101-py3-none-manylinux1_x86_64.whl (14.0 MB)
Using cached nvidia_cuda_nvcc_cu12-12.3.107-py3-none-manylinux1_x86_64.whl (22.0 MB)
Using cached nvidia_cuda_nvrtc_cu12-12.3.107-py3-none-manylinux1_x86_64.whl (24.9 MB)
Using cached nvidia_cuda_runtime_cu12-12.3.101-py3-none-manylinux1_x86_64.whl (867 kB)
Using cached nvidia_cudnn_cu12-8.9.7.29-py3-none-manylinux1_x86_64.whl (704.7 MB)
Using cached nvidia_cufft_cu12-11.0.12.1-py3-none-manylinux1_x86_64.whl (98.8 MB)
Using cached nvidia_curand_cu12-10.3.4.107-py3-none-manylinux1_x86_64.whl (56.3 MB)
Using cached nvidia_cusolver_cu12-11.5.4.101-py3-none-manylinux1_x86_64.whl (125.2 MB)
Using cached nvidia_cusparse_cu12-12.2.0.103-py3-none-manylinux1_x86_64.whl (197.5 MB)
Using cached nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl (166.0 MB)
Using cached nvidia_nvjitlink_cu12-12.3.101-py3-none-manylinux1_x86_64.whl (20.5 MB)
Using cached absl_py-2.1.0-py3-none-any.whl (133 kB)
Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 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.65.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB)
Using cached h5py-3.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB)
Using cached keras-3.5.0-py3-none-any.whl (1.1 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 numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Using cached protobuf-4.25.4-cp37-abi3-manylinux2014_x86_64.whl (294 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached tensorboard-2.16.2-py3-none-any.whl (5.5 MB)
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.4.0-py3-none-any.whl (7.7 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Using cached wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (80 kB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)
Using cached charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached Markdown-3.6-py3-none-any.whl (105 kB)
Using cached tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl (6.6 MB)
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Using cached werkzeug-3.0.3-py3-none-any.whl (227 kB)
Using cached namex-0.0.8-py3-none-any.whl (5.8 kB)
Using cached optree-0.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (347 kB)
Using cached rich-13.7.1-py3-none-any.whl (240 kB)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Using cached MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: namex, libclang, flatbuffers, wrapt, urllib3, typing-extensions, termcolor, tensorflow-io-gcs-filesystem, tensorboard-data-server, six, pygments, protobuf, packaging, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-nvcc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, mdurl, MarkupSafe, markdown, idna, grpcio, gast, charset-normalizer, certifi, absl-py, werkzeug, requests, optree, opt-einsum, nvidia-cusparse-cu12, nvidia-cudnn-cu12, ml-dtypes, markdown-it-py, h5py, google-pasta, astunparse, tensorboard, rich, nvidia-cusolver-cu12, keras, tensorflow
Successfully installed MarkupSafe-2.1.5 absl-py-2.1.0 astunparse-1.6.3 certifi-2024.7.4 charset-normalizer-3.3.2 flatbuffers-24.3.25 gast-0.6.0 google-pasta-0.2.0 grpcio-1.65.4 h5py-3.11.0 idna-3.7 keras-3.5.0 libclang-18.1.1 markdown-3.6 markdown-it-py-3.0.0 mdurl-0.1.2 ml-dtypes-0.3.2 namex-0.0.8 numpy-1.26.4 nvidia-cublas-cu12-12.3.4.1 nvidia-cuda-cupti-cu12-12.3.101 nvidia-cuda-nvcc-cu12-12.3.107 nvidia-cuda-nvrtc-cu12-12.3.107 nvidia-cuda-runtime-cu12-12.3.101 nvidia-cudnn-cu12-8.9.7.29 nvidia-cufft-cu12-11.0.12.1 nvidia-curand-cu12-10.3.4.107 nvidia-cusolver-cu12-11.5.4.101 nvidia-cusparse-cu12-12.2.0.103 nvidia-nccl-cu12-2.19.3 nvidia-nvjitlink-cu12-12.3.101 opt-einsum-3.3.0 optree-0.12.1 packaging-24.1 protobuf-4.25.4 pygments-2.18.0 requests-2.32.3 rich-13.7.1 six-1.16.0 tensorboard-2.16.2 tensorboard-data-server-0.7.2 tensorflow-2.16.2 tensorflow-io-gcs-filesystem-0.37.1 termcolor-2.4.0 typing-extensions-4.12.2 urllib3-2.2.2 werkzeug-3.0.3 wrapt-1.16.0
creating symlinks:
-  -> '../nvidia/cublas/lib/libcublasLt.so.12'
-  -> '../nvidia/cublas/lib/libcublas.so.12'
-  -> '../nvidia/cublas/lib/libnvblas.so.12'
-  -> '../nvidia/cuda_cupti/lib/libcheckpoint.so'
-  -> '../nvidia/cuda_cupti/lib/libcupti.so.12'
-  -> '../nvidia/cuda_cupti/lib/libnvperf_host.so'
-  -> '../nvidia/cuda_cupti/lib/libnvperf_target.so'
-  -> '../nvidia/cuda_cupti/lib/libpcsamplingutil.so'
-  -> '../nvidia/cuda_nvrtc/lib/libnvrtc-builtins.so.12.3'
-  -> '../nvidia/cuda_nvrtc/lib/libnvrtc.so.12'
-  -> '../nvidia/cuda_runtime/lib/libcudart.so.12'
-  -> '../nvidia/cudnn/lib/libcudnn_adv_infer.so.8'
-  -> '../nvidia/cudnn/lib/libcudnn_adv_train.so.8'
-  -> '../nvidia/cudnn/lib/libcudnn_cnn_infer.so.8'
-  -> '../nvidia/cudnn/lib/libcudnn_cnn_train.so.8'
-  -> '../nvidia/cudnn/lib/libcudnn_ops_infer.so.8'
-  -> '../nvidia/cudnn/lib/libcudnn_ops_train.so.8'
-  -> '../nvidia/cudnn/lib/libcudnn.so.8'
-  -> '../nvidia/cufft/lib/libcufft.so.11'
-  -> '../nvidia/cufft/lib/libcufftw.so.11'
-  -> '../nvidia/curand/lib/libcurand.so.10'
-  -> '../nvidia/cusolver/lib/libcusolverMg.so.11'
-  -> '../nvidia/cusolver/lib/libcusolver.so.11'
-  -> '../nvidia/cusparse/lib/libcusparse.so.12'
-  -> '../nvidia/nccl/lib/libnccl.so.2'
-  -> '../nvidia/nvjitlink/lib/libnvJitLink.so.12'
Error in file.symlink(from = from, to = to) : 
  no files/directory to link to
> tensorflow::as_tensor("Hello World")
Error: Valid installation of TensorFlow not found.

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

Python exception encountered:
 Traceback (most recent call last):
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/__init__.py", line 45, in <module>
    from tensorflow._api.v2 import __internal__
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name

RUNNING RECOMMENDED DIAGNOSTICS:

> reticulate::py_config()
python:         /home/-----/.virtualenvs/r-tensorflow/bin/python
libpython:      /home/-----/.pyenv/versions/3.10.14/lib/libpython3.10.so
pythonhome:     /home/-----/.virtualenvs/r-tensorflow:/home/-----/.virtualenvs/r-tensorflow
version:        3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]
numpy:          /home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/numpy
numpy_version:  1.26.4
tensorflow:     /home/-----/.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/-----/.pyenv/versions/3.10.14/bin/python3.10

Python exception encountered:
 Traceback (most recent call last):
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/__init__.py", line 45, in <module>
    from tensorflow._api.v2 import __internal__
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/framework/ops.py", line 33, in <module>
    from tensorflow.core.framework import attr_value_pb2
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/internal/builder.py", line 18, in <module>
    from google.protobuf.internal import python_message
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/internal/python_message.py", line 38, in <module>
    from google.protobuf import text_format
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/text_format.py", line 30, in <module>
    from google.protobuf.internal import type_checkers
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/internal/type_checkers.py", line 25, in <module>
    import ctypes
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.pyenv/versions/3.10.14/lib/python3.10/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/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.

> reticulate::py_last_error()

── Python Exception Message ────────────────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/__init__.py", line 45, in <module>
    from tensorflow._api.v2 import __internal__
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.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/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/python/framework/ops.py", line 33, in <module>
    from tensorflow.core.framework import attr_value_pb2
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/internal/builder.py", line 18, in <module>
    from google.protobuf.internal import python_message
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/internal/python_message.py", line 38, in <module>
    from google.protobuf import text_format
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/text_format.py", line 30, in <module>
    from google.protobuf.internal import type_checkers
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.virtualenvs/r-tensorflow/lib/python3.10/site-packages/google/protobuf/internal/type_checkers.py", line 25, in <module>
    import ctypes
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
  File "/home/-----/.pyenv/versions/3.10.14/lib/python3.10/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 96, in _run_hook
    module = hook()
  File "/home/-----/R/x86_64-pc-linux-gnu-library/4.1/reticulate/python/rpytools/loader.py", line 120, in _hook
    return _find_and_load(name, import_)
ModuleNotFoundError: No module named '_ctypes'

── R Traceback ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ▆
 1. └─reticulate::import("tensorflow")
 2.   └─reticulate:::py_module_import(module, convert = convert)
See `reticulate::py_last_error()$r_trace$full_call` for more details.
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.13            lattice_0.20-45        here_1.0.1             png_0.1-8              pak_0.7.2             
 [6] withr_3.0.1            rprojroot_2.0.4        rappdirs_0.3.3         grid_4.1.2             lifecycle_1.0.4       
[11] jsonlite_1.8.8         magrittr_2.0.3         tfruns_1.5.3           rlang_1.1.4            cli_3.6.3             
[16] rstudioapi_0.16.0      whisker_0.4.1          Matrix_1.4-0           reticulate_1.38.0.9000 tools_4.1.2           
[21] compiler_4.1.2         base64enc_0.1-3        tensorflow_2.16.0.9000

@netyasap
Copy link
Author

Not sure how many different times I've tried this install, including reinstalling OS in case something was screwed up and wanting to try with clean slate. Any help to finally get this done is much appreciated!

@t-kalinowski
Copy link
Member

t-kalinowski commented Aug 16, 2024

Thanks for filling out the template.

ModuleNotFoundError: No module named '_ctypes'

It looks the Python installation used to create the venv is incomplete. If you used pyenv or reticulate::install_python(), you can try to rebuild / reticulate::install_python(force=TRUE) and carefully read the output to see which build part is failing; usually the output also includes a hint for how to install it.

Consult https://github.com/pyenv/pyenv/wiki#suggested-build-environment (also linked to from help at ?reticulate::install_python to see the recommended remedy.

It looks like you're on Ubuntu, so the recommended command would be:

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

Then you'll probably want to wipe out all the previous builds of pyenv python:

rm -rf ~/.pyenv

And then rebuild python

reticulate::install_python(force = TRUE)

and then install create a new venv and install tensorflow + keras.

keras3::install_keras(backend = "tensorflow")

@netyasap
Copy link
Author

The suggestions above did the trick. Thank you! Now just need to install CUDA and cuDNN as described in Deep Learning with R and should be off and running. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants