Beginner Problems with keras / tensorflow

Hi everyone!

I'm absolutly new to Keras and Tensorflow and I just can't make things work.

When I run


keras::install_keras()

I get following Error

ERROR: Could not find a version that satisfies the requirement tensorflow==2.15.* (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.11.1, 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1)

ERROR: No matching distribution found for tensorflow==2.15.*

So I tryed to install with an older tensorflow Version


keras::install_keras(tensorflow = "2.13")

This time I succeeded but I get a few Warnings that say the scripts:

google-oauthlib-tool.exe, tensorboard.exe, estimator_ckpt_converter.exe, import_pb_to_tensorboard.exe, saved_model_cli.exe, tensorboard.exe, tf_upgrade_v2.exe, tflite_convert.exe, toco.exe and toco_from_protos.exe

are installed in

'C:\Users\XXX\anaconda3\envs\r-tensorflow\Scripts' which is not on PATH

The strange thing ist, when I run


Sys.getenv("PATH")

I get:

…;C:\Users\XXX\anaconda3\envs\r-tensorflow\Scripts;…

So I don’t see a problem

Anyways, when I run


library(keras)

model <- keras_model_sequential()

I get the following Error:

Fehler in py_get_attr(x, name, FALSE) :
AttributeError: module 'tensorflow' has no attribute 'VERSION'

I hope someone can help me, this is very frustrating

R Version 4.4, R Studio 2024.04.1