Failed to use subprocess.run in Rmarkdown

I tried to open a software using this python code in RStudio:

import subprocess

# Prueba apertura del symphoniepro
subprocess.run(" ".join([r'"C:/Program Files (x86)/Renewable NRG Systems/SymPRO Desktop/SymPRODesktop.exe"']), stdout=subprocess.PIPE)

But I get the error:

OSError: [WinError 6] the handle is invalid

I found other posts and they suggested to use stdin=subprocess.PIPE or stdin=subprocess.DEVNULL anyway it didn´t workout.

Any advice to handle this error.

This is my session info

sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19042)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=Spanish_Ecuador.1252  LC_CTYPE=Spanish_Ecuador.1252   
#> [3] LC_MONETARY=Spanish_Ecuador.1252 LC_NUMERIC=C                    
#> [5] LC_TIME=Spanish_Ecuador.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.27     withr_2.4.2       magrittr_2.0.1    reprex_2.0.0     
#>  [5] evaluate_0.14     highr_0.9         stringi_1.6.2     rlang_0.4.11     
#>  [9] cli_3.0.0         rstudioapi_0.13   fs_1.5.0          rmarkdown_2.9    
#> [13] tools_4.1.0       stringr_1.4.0     glue_1.4.2        xfun_0.24        
#> [17] yaml_2.2.1        compiler_4.1.0    htmltools_0.5.1.1 knitr_1.33

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.