rstudio / tensorflow.rstudio.com

https://tensorflow.rstudio.com
9 stars 12 forks source link

Unable to set up a consistent R environment for reticulate, tensorflow, and keras #70

Open lghunsicker opened 7 months ago

lghunsicker commented 7 months ago

I am trying to set up a consistent R environment for reticulate, tensorflow, and keras, using instructions from the website TensorFlow for R - Quick start (https://tensorflow.rstudio.com/install/). After several stabs at doing this correctly, my current code is: library(reticulate) remotes::install_github("rstudio/tensorflow") path_to_python <- install_python(version = '3.10:latest') virtualenv_create("r-reticulate", python = path_to_python) library(tensorflow) install_tensorflow(envname = "r-tensorflow", version = '2.13') library(keras) install_keras()

lghunsicker commented 7 months ago

Sorry for the interruption. All goes well until the last step, which abends after failing to build wheels.

Any suggestions to get me up and running will be deeply appreciated.

[Building wheels for collected packages: promise
  Building wheel for promise (setup.py): started
  Building wheel for promise (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-c0cwpm8y/promise_41af5ca2d160431692e26dd1112cf49d/setup.py", line 28, in <module>
          setup(
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 172, in setup
          ok = dist.parse_command_line()
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 475, in parse_command_line
          args = self._parse_command_opts(parser, args)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/dist.py", line 865, in _parse_command_opts
          nargs = _Distribution._parse_command_opts(self, parser, args)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 534, in _parse_command_opts
          cmd_class = self.get_command_class(command)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/dist.py", line 710, in get_command_class
          self.cmdclass[command] = cmdclass = ep.load()
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 208, in load
          module = import_module(match.group('module'))
        File "/home/hunsickerl/.pyenv/versions/3.9.16/lib/python3.9/importlib/__init__.py", line 127, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 855, in exec_module
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 27, in <module>
          from .macosx_libfile import calculate_macosx_platform_tag
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/wheel/macosx_libfile.py", line 43, in <module>
          import ctypes
        File "/home/hunsickerl/.pyenv/versions/3.9.16/lib/python3.9/ctypes/__init__.py", line 8, in <module>
          from _ctypes import Union, Structure, Array
      ModuleNotFoundError: No module named '_ctypes'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for promise
  Running setup.py clean for promise
Failed to build promise
ERROR: Could not build wheels for promise, which is required to install pyproject.toml-based projects
Error: Error installing package(s): "'tensorflow==2.13.*'", "tensorflow-hub", "tensorflow-datasets", "scipy", "requests", "Pillow", "h5py", "pandas", "pydot"

Running R version, etc.
[version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          3.1                         
year           2023                        
month          06                          
day            16                          
svn rev        84548                       
language       R                           
version.string R version 4.3.1 (2023-06-16)
nickname       Beagle Scouts      ](url)         
t-kalinowski commented 7 months ago

Can you please provide the full contents of the console when running the commands, as well as the full output from sessionInfo() and reticulate::py_config()?

lghunsicker commented 7 months ago

Thanks for the rapid response! I have been fussing on this business for a couple of days. As you will see from the third long piece below showing the results of the attempt at installing tensorflow today on a clean copy of the desktop, the outcome was a bit different, as the commands seemed to complete successfully. But the test command "tf$constant("Hello Tensorflow!")" still showed that tensorflow was not correctly installed. This was repeatable when I closed the first attempt and then repeated everything with another clean copy of the desktop. Thanks for your help. I really appreciate it. Larry

sessionInfo()

R version 4.3.1 (2023-06-16) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.6 LTS

Matrix products: default BLAS/LAPACK: /opt/OpenBLAS/lib/libopenblasp-r0.3.3.so; LAPACK version 3.8.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

time zone: America/Chicago tzcode source: system (glibc)

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

other attached packages: [1] keras_2.13.0 tensorflow_2.15.0.9000 reticulate_1.35.0 grpreg_3.4.0 ggplot2_3.4.4 [6] corrplot_0.92 dplyr_1.1.4 magrittr_2.0.3

loaded via a namespace (and not attached): [1] Matrix_1.6-5 gtable_0.3.4 jsonlite_1.8.8 compiler_4.3.1 tidyselect_1.2.0 Rcpp_1.0.12 zeallot_0.1.0 [8] tfruns_1.5.2 scales_1.2.1 png_0.1-8 lattice_0.22-5 here_1.0.1 R6_2.5.1 generics_0.1.3 [15] tibble_3.2.1 munsell_0.5.0 rprojroot_2.0.4 pillar_1.9.0 rlang_1.1.2 utf8_1.2.4 cli_3.6.2 [22] withr_2.5.2 grid_4.3.1 rstudioapi_0.15.0 remotes_2.4.2.1 base64enc_0.1-3 lifecycle_1.0.4 vctrs_0.6.4 [29] glue_1.6.2 whisker_0.4.1 fansi_1.0.5 colorspace_2.1-0 tools_4.3.1 pkgconfig_2.0.3

reticulate::py_config()python: /home/hunsickerl/.virtualenvs/r-tensorflow/bin/python libpython: /home/hunsickerl/.pyenv/versions/3.9.16/lib/libpython3.9.so pythonhome: /home/hunsickerl/.virtualenvs/r-tensorflow:/home/hunsickerl/.virtualenvs/r-tensorflow version: 3.9.5 (default, Nov 23 2021, 15:27:38) [GCC 9.3.0] numpy: /home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/numpy numpy_version: 1.24.3 tensorflow: /home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/tensorflow

NOTE: Python version was forced by import("tensorflow") Record of the attempted installation:

library(reticulate) remotes::install_github("rstudio/tensorflow") Skipping install of 'tensorflow' from a github remote, the SHA1 (15ee3a1f) has not changed since last install. Use force = TRUE to force installation path_to_python <- install_python(version = '3.10:latest')

  • /home/hunsickerl/.local/share/r-reticulate/pyenv/bin/pyenv update
  • /home/hunsickerl/.local/share/r-reticulate/pyenv/bin/pyenv install --skip-existing 3.10.13 virtualenv_create("r-reticulate", python = path_to_python) virtualenv: r-reticulate library(tensorflow) install_tensorflow(envname = "r-tensorflow", version = '2.13') Virtual environment 'r-tensorflow' removed. Using Python: /home/hunsickerl/.pyenv/versions/3.9.16/bin/python3.9 Creating virtual environment 'r-tensorflow' ...
  • /home/hunsickerl/.pyenv/versions/3.9.16/bin/python3.9 -m venv /home/hunsickerl/.virtualenvs/r-tensorflow Done! Installing packages: pip, wheel, setuptools
  • /home/hunsickerl/.virtualenvs/r-tensorflow/bin/python -m pip install --upgrade pip wheel setuptools Requirement already satisfied: pip in /home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages (22.0.4) Collecting pip Using cached pip-24.0-py3-none-any.whl (2.1 MB) Collecting wheel Using cached wheel-0.42.0-py3-none-any.whl (65 kB) Requirement already satisfied: setuptools in /home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages (58.1.0) Collecting setuptools Using cached setuptools-69.1.0-py3-none-any.whl (819 kB) Installing collected packages: wheel, setuptools, pip Attempting uninstall: setuptools Found existing installation: setuptools 58.1.0 Uninstalling setuptools-58.1.0: Successfully uninstalled setuptools-58.1.0 Attempting uninstall: pip Found existing installation: pip 22.0.4 Uninstalling pip-22.0.4: Successfully uninstalled pip-22.0.4 Successfully installed pip-24.0 setuptools-69.1.0 wheel-0.42.0 Virtual environment 'r-tensorflow' successfully created. Using virtual environment 'r-tensorflow' ...
  • /home/hunsickerl/.virtualenvs/r-tensorflow/bin/python -m pip install --upgrade --no-user 'tensorflow==2.13.' Collecting tensorflow==2.13. Using cached tensorflow-2.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.4 kB) Collecting absl-py>=1.0.0 (from tensorflow==2.13.) Using cached absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB) Collecting astunparse>=1.6.0 (from tensorflow==2.13.) Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting flatbuffers>=23.1.21 (from tensorflow==2.13.) Using cached flatbuffers-23.5.26-py2.py3-none-any.whl.metadata (850 bytes) Collecting gast<=0.4.0,>=0.2.1 (from tensorflow==2.13.) Using cached gast-0.4.0-py3-none-any.whl (9.8 kB) Collecting google-pasta>=0.1.1 (from tensorflow==2.13.) Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB) Collecting grpcio<2.0,>=1.24.3 (from tensorflow==2.13.) Using cached grpcio-1.60.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB) Collecting h5py>=2.9.0 (from tensorflow==2.13.) Using cached h5py-3.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.5 kB) Collecting keras<2.14,>=2.13.1 (from tensorflow==2.13.) Using cached keras-2.13.1-py3-none-any.whl.metadata (2.4 kB) Collecting libclang>=13.0.0 (from tensorflow==2.13.) Using cached libclang-16.0.6-py2.py3-none-manylinux2010_x86_64.whl.metadata (5.2 kB) Collecting numpy<=1.24.3,>=1.22 (from tensorflow==2.13.) Using cached numpy-1.24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB) Collecting opt-einsum>=2.3.2 (from tensorflow==2.13.) Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB) Collecting packaging (from tensorflow==2.13.) Using cached packaging-23.2-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.13.) Using cached protobuf-4.25.2-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes) Requirement already satisfied: setuptools in /home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages (from tensorflow==2.13.) (69.1.0) Collecting six>=1.12.0 (from tensorflow==2.13.) Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting tensorboard<2.14,>=2.13 (from tensorflow==2.13.) Using cached tensorboard-2.13.0-py3-none-any.whl (5.6 MB) Collecting tensorflow-estimator<2.14,>=2.13.0 (from tensorflow==2.13.) Using cached tensorflow_estimator-2.13.0-py2.py3-none-any.whl.metadata (1.3 kB) Collecting termcolor>=1.1.0 (from tensorflow==2.13.) Using cached termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB) Collecting typing-extensions<4.6.0,>=3.6.6 (from tensorflow==2.13.) Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB) Collecting wrapt>=1.11.0 (from tensorflow==2.13.) Using cached wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB) Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow==2.13.) Using cached tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (14 kB) Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages (from astunparse>=1.6.0->tensorflow==2.13.) (0.42.0) Collecting google-auth<3,>=1.6.3 (from tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached google_auth-2.27.0-py2.py3-none-any.whl.metadata (4.7 kB) Collecting google-auth-oauthlib<1.1,>=0.5 (from tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB) Collecting markdown>=2.6.8 (from tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached Markdown-3.5.2-py3-none-any.whl.metadata (7.0 kB) Collecting requests<3,>=2.21.0 (from tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB) Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard<2.14,>=2.13->tensorflow==2.13.) 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.14,>=2.13->tensorflow==2.13.) Using cached werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB) Collecting cachetools<6.0,>=2.0.0 (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached cachetools-5.3.2-py3-none-any.whl.metadata (5.2 kB) Collecting pyasn1-modules>=0.2.1 (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB) Collecting rsa<5,>=3.1.4 (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached rsa-4.9-py3-none-any.whl (34 kB) Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB) Collecting importlib-metadata>=4.4 (from markdown>=2.6.8->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached importlib_metadata-7.0.1-py3-none-any.whl.metadata (4.9 kB) Collecting charset-normalizer<4,>=2 (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB) Collecting idna<4,>=2.5 (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached idna-3.6-py3-none-any.whl.metadata (9.9 kB) Collecting urllib3<3,>=1.21.1 (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached urllib3-2.2.0-py3-none-any.whl.metadata (6.4 kB) Collecting certifi>=2017.4.17 (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB) Collecting MarkupSafe>=2.1.1 (from werkzeug>=1.0.1->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB) Collecting zipp>=0.5 (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached zipp-3.17.0-py3-none-any.whl.metadata (3.7 kB) Collecting pyasn1<0.6.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.) Using cached pyasn1-0.5.1-py2.py3-none-any.whl.metadata (8.6 kB) Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow==2.13.*) Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB) Using cached tensorflow-2.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479.7 MB) Using cached absl_py-2.1.0-py3-none-any.whl (133 kB) Using cached flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB) Using cached grpcio-1.60.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB) Using cached h5py-3.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB) Using cached keras-2.13.1-py3-none-any.whl (1.7 MB) Using cached libclang-16.0.6-py2.py3-none-manylinux2010_x86_64.whl (22.9 MB) Using cached protobuf-4.25.2-cp37-abi3-manylinux2014_x86_64.whl (294 kB) Using cached tensorflow_estimator-2.13.0-py2.py3-none-any.whl (440 kB) Using cached tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-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 wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (80 kB) Using cached packaging-23.2-py3-none-any.whl (53 kB) Using cached google_auth-2.27.0-py2.py3-none-any.whl (186 kB) Using cached Markdown-3.5.2-py3-none-any.whl (103 kB) Using cached requests-2.31.0-py3-none-any.whl (62 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.1-py3-none-any.whl (226 kB) Using cached cachetools-5.3.2-py3-none-any.whl (9.3 kB) Using cached certifi-2024.2.2-py3-none-any.whl (163 kB) Using cached charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB) Using cached idna-3.6-py3-none-any.whl (61 kB) Using cached importlib_metadata-7.0.1-py3-none-any.whl (23 kB) Using cached MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB) Using cached urllib3-2.2.0-py3-none-any.whl (120 kB) Using cached pyasn1-0.5.1-py2.py3-none-any.whl (84 kB) Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB) Installing collected packages: libclang, flatbuffers, zipp, wrapt, urllib3, typing-extensions, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard-data-server, six, pyasn1, protobuf, packaging, oauthlib, numpy, MarkupSafe, keras, idna, grpcio, gast, charset-normalizer, certifi, cachetools, absl-py, werkzeug, rsa, requests, pyasn1-modules, opt-einsum, importlib-metadata, h5py, google-pasta, astunparse, requests-oauthlib, markdown, google-auth, google-auth-oauthlib, tensorboard, tensorflow Successfully installed MarkupSafe-2.1.5 absl-py-2.1.0 astunparse-1.6.3 cachetools-5.3.2 certifi-2024.2.2 charset-normalizer-3.3.2 flatbuffers-23.5.26 gast-0.4.0 google-auth-2.27.0 google-auth-oauthlib-1.0.0 google-pasta-0.2.0 grpcio-1.60.1 h5py-3.10.0 idna-3.6 importlib-metadata-7.0.1 keras-2.13.1 libclang-16.0.6 markdown-3.5.2 numpy-1.24.3 oauthlib-3.2.2 opt-einsum-3.3.0 packaging-23.2 protobuf-4.25.2 pyasn1-0.5.1 pyasn1-modules-0.3.0 requests-2.31.0 requests-oauthlib-1.3.1 rsa-4.9 six-1.16.0 tensorboard-2.13.0 tensorboard-data-server-0.7.2 tensorflow-2.13.1 tensorflow-estimator-2.13.0 tensorflow-io-gcs-filesystem-0.36.0 termcolor-2.4.0 typing-extensions-4.5.0 urllib3-2.2.0 werkzeug-3.0.1 wrapt-1.16.0 zipp-3.17.0

Installation complete.

library(keras) install_keras()

Restarting R session...

Error: Error occurred during transmission

tf$constant("Hello Tensorflow!") Error: Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package: /home/hunsickerl/.pyenv/versions/3.9.16/bin/python3.9

Python exception encountered: Traceback (most recent call last): File "/home/hunsickerl/R/x86_64-pc-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook return _run_hook(name, _hook) File "/home/hunsickerl/R/x86_64-pc-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 93, in _run_hook module = hook() File "/home/hunsickerl/R/x86_64-pc-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 117, in _hook return _find_andload(name, import) File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/tensorflow/init.py", line 38, in from tensorflow.python.tools import module_util as _module_util File "/home/hunsickerl/R/x86_64-pc-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 119, in _fin

On Mon, Feb 12, 2024 at 7:28 AM Tomasz Kalinowski @.***> wrote:

Can you please provide the full contents of the console when running the commands, as well as the full output from sessionInfo() and reticulate::py_config()?

— Reply to this email directly, view it on GitHub https://github.com/rstudio/tensorflow.rstudio.com/issues/70#issuecomment-1938680274, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV4AP77272Q6K2UBIUNMJ5TYTIKGVAVCNFSM6AAAAABDECIMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZYGY4DAMRXGQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Larry Hunsicker

lghunsicker commented 7 months ago

Addendum:

When I looked again at the output that I sent you a moment ago, I noted that when RStudio rebooted following the "install_tensorflow(envname = "r-tensorflow", version = '2.13')", it also issued the response, "Error: Error occurred during transmission", before executing the "install_keras()" command, apparently successfully. I wondered whether the "Error [that had] occurred during transmission" had screwed up the install_keras() command, so I tried the "install_keras()" again. Alas, the installation of keras failed this time, again noting the problem that it "Failed to build promise." and "Could not build wheels for promise..." I wondered whether this result might clarify why the installation of tensorflow had failed. I'm sorry to dump all this output on you. It's mostly Greek to me. But it might help to figure out what's going wrong. Larry

> install_keras()Virtual environment 'r-tensorflow' removed.
Using Python: /home/hunsickerl/.pyenv/versions/3.9.16/bin/python3.9
Creating virtual environment 'r-tensorflow' ... +
/home/hunsickerl/.pyenv/versions/3.9.16/bin/python3.9 -m venv
/home/hunsickerl/.virtualenvs/r-tensorflowDone!
Installing packages: pip, wheel, setuptools+
/home/hunsickerl/.virtualenvs/r-tensorflow/bin/python -m pip install
--upgrade pip wheel setuptoolsRequirement already satisfied: pip in
/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages
(22.0.4)
Collecting pip
  Using cached pip-24.0-py3-none-any.whl (2.1 MB)
Collecting wheel
  Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
Requirement already satisfied: setuptools in
/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages
(58.1.0)
Collecting setuptools
  Using cached setuptools-69.1.0-py3-none-any.whl (819 kB)
Installing collected packages: wheel, setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.1.0
    Uninstalling setuptools-58.1.0:
      Successfully uninstalled setuptools-58.1.0
  Attempting uninstall: pip
    Found existing installation: pip 22.0.4
    Uninstalling pip-22.0.4:
      Successfully uninstalled pip-22.0.4
Successfully installed pip-24.0 setuptools-69.1.0 wheel-0.42.0
Virtual environment 'r-tensorflow' successfully created.
Using virtual environment 'r-tensorflow' ...+
/home/hunsickerl/.virtualenvs/r-tensorflow/bin/python -m pip install
--upgrade --no-user 'tensorflow==2.13.*' tensorflow-hub
tensorflow-datasets scipy requests Pillow h5py pandas pydotCollecting
tensorflow==2.13.*
  Using cached tensorflow-2.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(3.4 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.3-py3-none-any.whl.metadata (9.3 kB)
Collecting scipy
  Using cached scipy-1.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(60 kB)
Collecting requests
  Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting Pillow
  Using cached pillow-10.2.0-cp39-cp39-manylinux_2_28_x86_64.whl.metadata
(9.7 kB)
Collecting h5py
  Using cached h5py-3.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(2.5 kB)
Collecting pandas
  Using cached pandas-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(19 kB)
Collecting pydot
  Using cached pydot-2.0.0-py3-none-any.whl.metadata (9.6 kB)
Collecting absl-py>=1.0.0 (from tensorflow==2.13.*)
  Using cached absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting astunparse>=1.6.0 (from tensorflow==2.13.*)
  Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting flatbuffers>=23.1.21 (from tensorflow==2.13.*)
  Using cached flatbuffers-23.5.26-py2.py3-none-any.whl.metadata (850 bytes)
Collecting gast<=0.4.0,>=0.2.1 (from tensorflow==2.13.*)
  Using cached gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting google-pasta>=0.1.1 (from tensorflow==2.13.*)
  Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting grpcio<2.0,>=1.24.3 (from tensorflow==2.13.*)
  Using cached grpcio-1.60.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(4.0 kB)
Collecting keras<2.14,>=2.13.1 (from tensorflow==2.13.*)
  Using cached keras-2.13.1-py3-none-any.whl.metadata (2.4 kB)
Collecting libclang>=13.0.0 (from tensorflow==2.13.*)
  Using cached libclang-16.0.6-py2.py3-none-manylinux2010_x86_64.whl.metadata
(5.2 kB)
Collecting numpy<=1.24.3,>=1.22 (from tensorflow==2.13.*)
  Using cached numpy-1.24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(17.3 MB)
Collecting opt-einsum>=2.3.2 (from tensorflow==2.13.*)
  Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Collecting packaging (from tensorflow==2.13.*)
  Using cached packaging-23.2-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.13.*)
  Using cached protobuf-4.25.2-cp37-abi3-manylinux2014_x86_64.whl.metadata
(541 bytes)
Requirement already satisfied: setuptools in
/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages
(from tensorflow==2.13.*) (69.1.0)
Collecting six>=1.12.0 (from tensorflow==2.13.*)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting tensorboard<2.14,>=2.13 (from tensorflow==2.13.*)
  Using cached tensorboard-2.13.0-py3-none-any.whl (5.6 MB)
Collecting tensorflow-estimator<2.14,>=2.13.0 (from tensorflow==2.13.*)
  Using cached tensorflow_estimator-2.13.0-py2.py3-none-any.whl.metadata
(1.3 kB)
Collecting termcolor>=1.1.0 (from tensorflow==2.13.*)
  Using cached termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB)
Collecting typing-extensions<4.6.0,>=3.6.6 (from tensorflow==2.13.*)
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting wrapt>=1.11.0 (from tensorflow==2.13.*)
  Using cached wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(6.6 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow==2.13.*)
  Using cached tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(14 kB)
Collecting tf-keras>=2.14.1 (from tensorflow-hub)
  Using cached tf_keras-2.15.0-py3-none-any.whl.metadata (1.6 kB)
Collecting array-record (from tensorflow-datasets)
  Using cached array_record-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(503 bytes)
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-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(153 kB)
Collecting etils>=0.9.0 (from
etils[enp,epath,etree]>=0.9.0->tensorflow-datasets)
  Using cached etils-1.5.2-py3-none-any.whl.metadata (6.3 kB)
Collecting promise (from tensorflow-datasets)
  Using cached promise-2.3.tar.gz (19 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting psutil (from tensorflow-datasets)
  Using cached psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(21 kB)
Collecting tensorflow-metadata (from tensorflow-datasets)
  Using cached tensorflow_metadata-1.14.0-py3-none-any.whl.metadata (2.1 kB)
Collecting toml (from tensorflow-datasets)
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting tqdm (from tensorflow-datasets)
  Using cached tqdm-4.66.2-py3-none-any.whl.metadata (57 kB)
Collecting charset-normalizer<4,>=2 (from requests)
  Using cached charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(33 kB)
Collecting idna<4,>=2.5 (from requests)
  Using cached idna-3.6-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests)
  Using cached urllib3-2.2.0-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests)
  Using cached certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
Collecting python-dateutil>=2.8.2 (from pandas)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz>=2020.1 (from pandas)
  Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas)
  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting pyparsing>=3 (from pydot)
  Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Requirement already satisfied: wheel<1.0,>=0.23.0 in
/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages
(from astunparse>=1.6.0->tensorflow==2.13.*) (0.42.0)
Collecting fsspec (from etils[enp,epath,etree]>=0.9.0->tensorflow-datasets)
  Using cached fsspec-2024.2.0-py3-none-any.whl.metadata (6.8 kB)
Collecting importlib_resources (from
etils[enp,epath,etree]>=0.9.0->tensorflow-datasets)
  Using cached importlib_resources-6.1.1-py3-none-any.whl.metadata (4.1 kB)
Collecting zipp (from etils[enp,epath,etree]>=0.9.0->tensorflow-datasets)
  Using cached zipp-3.17.0-py3-none-any.whl.metadata (3.7 kB)
Collecting google-auth<3,>=1.6.3 (from
tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached google_auth-2.27.0-py2.py3-none-any.whl.metadata (4.7 kB)
Collecting google-auth-oauthlib<1.1,>=0.5 (from
tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
Collecting markdown>=2.6.8 (from tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached Markdown-3.5.2-py3-none-any.whl.metadata (7.0 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from
tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  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.14,>=2.13->tensorflow==2.13.*)
  Using cached werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB)
Collecting absl-py>=1.0.0 (from tensorflow==2.13.*)
  Using cached absl_py-1.4.0-py3-none-any.whl (126 kB)
Collecting googleapis-common-protos<2,>=1.52.0 (from
tensorflow-metadata->tensorflow-datasets)
  Using cached googleapis_common_protos-1.62.0-py2.py3-none-any.whl.metadata
(1.5 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.13.*)
  Using cached protobuf-3.20.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
(1.0 MB)
Collecting cachetools<6.0,>=2.0.0 (from
google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached cachetools-5.3.2-py3-none-any.whl.metadata (5.2 kB)
Collecting pyasn1-modules>=0.2.1 (from
google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
Collecting rsa<5,>=3.1.4 (from
google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached rsa-4.9-py3-none-any.whl (34 kB)
Collecting requests-oauthlib>=0.7.0 (from
google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting importlib-metadata>=4.4 (from
markdown>=2.6.8->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached importlib_metadata-7.0.1-py3-none-any.whl.metadata (4.9 kB)
Collecting MarkupSafe>=2.1.1 (from
werkzeug>=1.0.1->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
(3.0 kB)
Collecting pyasn1<0.6.0,>=0.4.6 (from
pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached pyasn1-0.5.1-py2.py3-none-any.whl.metadata (8.6 kB)
Collecting oauthlib>=3.0.0 (from
requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow==2.13.*)
  Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
Using cached tensorflow-2.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(479.7 MB)
Using cached tensorflow_hub-0.16.1-py2.py3-none-any.whl (30 kB)
Using cached tensorflow_datasets-4.9.3-py3-none-any.whl (5.0 MB)
Using cached scipy-1.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(38.5 MB)
Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Using cached pillow-10.2.0-cp39-cp39-manylinux_2_28_x86_64.whl (4.5 MB)
Using cached h5py-3.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(4.8 MB)
Using cached pandas-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(13.0 MB)
Using cached pydot-2.0.0-py3-none-any.whl (22 kB)
Using cached certifi-2024.2.2-py3-none-any.whl (163 kB)
Using cached charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(142 kB)
Using cached etils-1.5.2-py3-none-any.whl (140 kB)
Using cached flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB)
Using cached grpcio-1.60.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(5.4 MB)
Using cached idna-3.6-py3-none-any.whl (61 kB)
Using cached keras-2.13.1-py3-none-any.whl (1.7 MB)
Using cached libclang-16.0.6-py2.py3-none-manylinux2010_x86_64.whl (22.9 MB)
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached tensorflow_estimator-2.13.0-py2.py3-none-any.whl (440 kB)
Using cached tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-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 tf_keras-2.15.0-py3-none-any.whl (1.7 MB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached urllib3-2.2.0-py3-none-any.whl (120 kB)
Using cached wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(80 kB)
Using cached array_record-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(3.0 MB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Using cached psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(288 kB)
Using cached tensorflow_metadata-1.14.0-py3-none-any.whl (28 kB)
Using cached tqdm-4.66.2-py3-none-any.whl (78 kB)
Using cached google_auth-2.27.0-py2.py3-none-any.whl (186 kB)
Using cached googleapis_common_protos-1.62.0-py2.py3-none-any.whl (228 kB)
Using cached Markdown-3.5.2-py3-none-any.whl (103 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.1-py3-none-any.whl (226 kB)
Using cached fsspec-2024.2.0-py3-none-any.whl (170 kB)
Using cached importlib_resources-6.1.1-py3-none-any.whl (33 kB)
Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
Using cached cachetools-5.3.2-py3-none-any.whl (9.3 kB)
Using cached importlib_metadata-7.0.1-py3-none-any.whl (23 kB)
Using cached MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
(25 kB)
Using cached pyasn1-0.5.1-py2.py3-none-any.whl (84 kB)
Building wheels for collected packages: promise
  Building wheel for promise (setup.py): started
  Building wheel for promise (setup.py): finished with status 'error'
error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ovrlnmbc/promise_2fbda9d933184873a9becb62004b30d3/setup.py",
line 28, in <module>
          setup(
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/__init__.py",
line 103, in setup
          return distutils.core.setup(**attrs)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_distutils/core.py",
line 172, in setup
          ok = dist.parse_command_line()
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_distutils/dist.py",
line 475, in parse_command_line
          args = self._parse_command_opts(parser, args)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/dist.py",
line 865, in _parse_command_opts
          nargs = _Distribution._parse_command_opts(self, parser, args)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_distutils/dist.py",
line 534, in _parse_command_opts
          cmd_class = self.get_command_class(command)
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/dist.py",
line 710, in get_command_class
          self.cmdclass[command] = cmdclass = ep.load()
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/setuptools/_vendor/importlib_metadata/__init__.py",
line 208, in load
          module = import_module(match.group('module'))
        File "/home/hunsickerl/.pyenv/versions/3.9.16/lib/python3.9/importlib/__init__.py",
line 127, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 986, in
_find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 855, in exec_module
        File "<frozen importlib._bootstrap>", line 228, in
_call_with_frames_removed
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/wheel/bdist_wheel.py",
line 27, in <module>
          from .macosx_libfile import calculate_macosx_platform_tag
        File "/home/hunsickerl/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/wheel/macosx_libfile.py",
line 43, in <module>
          import ctypes
        File "/home/hunsickerl/.pyenv/versions/3.9.16/lib/python3.9/ctypes/__init__.py",
line 8, in <module>
          from _ctypes import Union, Structure, Array
      ModuleNotFoundError: No module named '_ctypes'
      [end of output]

  note: This error originates from a subprocess, and is likely not a
problem with pip.
  ERROR: Failed building wheel for promise  Running setup.py clean for promise
Failed to build promiseERROR: Could not build wheels for promise,
which is required to install pyproject.toml-based projectsError: Error
installing package(s): "'tensorflow==2.13.*'", "tensorflow-hub",
"tensorflow-datasets", "scipy", "requests", "Pillow", "h5py",
"pandas", "pydot"

On Mon, Feb 12, 2024 at 7:28 AM Tomasz Kalinowski @.***> wrote:

Can you please provide the full contents of the console when running the commands, as well as the full output from sessionInfo() and reticulate::py_config()?

— Reply to this email directly, view it on GitHub https://github.com/rstudio/tensorflow.rstudio.com/issues/70#issuecomment-1938680274, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV4AP77272Q6K2UBIUNMJ5TYTIKGVAVCNFSM6AAAAABDECIMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZYGY4DAMRXGQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Larry Hunsicker

t-kalinowski commented 7 months ago

In the future, please avoid putting output like this in emails, and prefer creating the comment on the issue thread through the github web ui. The reason being that the output is rewrapped, and becomes quite difficult to read (also, markdown formatting for email replies is not supported by github, so it's impossible to format it as monospaced text).


This is the most salient line in the output:

ModuleNotFoundError: No module named '_ctypes'

This indicates an incomplete python installation. I suspect that running reticulate::install_python(force=TRUE) will fix the issue, or print some output detailing what dependency is missing.

Since you're on mac, probably the most convenient way to install the dependency is install brew, which reticulate can use to dynamically fetch the dependency https://brew.sh (just open up Terminal.app, copy and paste the line from the "Install Homebrew" section into it, press enter).

Alternatively, you can install pre-built binaries from www.python.org/downloads (be sure to install a slightly older version, 3.9-3.11). Then point you can reticulate/tensorflow at the installed python with something like

tensorflow::install_tensorflow(
  python_version = "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11"
)

... pip install ... 'tensorflow==2.13.*'

This indicates you're not using the latest CRAN version of the tensorflow R package (which would install Tensorflow version 2.15). Please make sure you are using the latest release version of tensorflow, reticulate, and keras. install.packages(c("tensorflow", "reticulate", "keras"))