Skip to content
Back to formatted view

Raw Message

Message-ID: <b0c33e6b-88ab-4e3f-b3a6-a7324014801f@dewey.myzen.co.uk>
Date: 2025-02-07T16:06:54Z
From: Michael Dewey
Subject: [R-pkg-devel]  How to solve this error while running python script in R environment?
In-Reply-To: <AS8PR02MB10148368DB584F8B99E1D8136ACF12@AS8PR02MB10148.eurprd02.prod.outlook.com>

Have you got tensorflow installed somewhere where R knows about it?

Michael

On 07/02/2025 06:51, KABILAN S wrote:
> When I am creating the R package based on the python script, I am getting the below error while checking the package.
> 
> 
> * checking examples ... [60s] ERROR
> Running examples in 'transformerForecasting-Ex.R' failed
> The error most likely occurred in:
> 
>> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
>> ### Name: TRANSFORMER
>> ### Title: Transformer Model for Time Series Forecasting
>> ### Aliases: TRANSFORMER
>>
>> ### ** Examples
>>
>> data(S_P_500_Close_data)
>> df <- S_P_500_Close_data
>> result <- TRANSFORMER(df = S_P_500_Close_data, study_variable = "Price")
> Error: Valid installation of TensorFlow not found.
> 
> Python environments searched for 'tensorflow' package:
>   C:\Users\CRAN\Documents\.virtualenvs\r-reticulate\Scripts\python.exe
> 
> Python exception encountered:
>   Traceback (most recent call last):
>    File "D:\RCompile\CRANpkg\lib\4.5\reticulate\python\rpytools\loader.py", line 122, in _find_and_load_hook
>      return _run_hook(name, _hook)
>             ^^^^^^^^^^^^^^^^^^^^^^
>    File "D:\RCompile\CRANpkg\lib\4.5\reticulate\python\rpytools\loader.py", line 96, in _run_hook
>      module = hook()
>               ^^^^^^
>    File "D:\RCompile\CRANpkg\lib\4.5\reticulate\python\rpytools\loader.py", line 120, in _hook
>      return _find_and_load(name, import_)
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ModuleNotFoundError: No module named 'tensorflow'
> 
> 
> You can install TensorFlow using the install_tensorflow() function.
> Execution halted
> 
> How to solve this?
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 

-- 
Michael Dewey