radian icon indicating copy to clipboard operation
radian copied to clipboard

radian works only when hardcoding `R_HOME` path

Open isaactpetersen opened this issue 2 years ago • 2 comments

radian works for me only when hardcoding the R_HOME path in the environment variables: R_HOME = C:\R\R-4.2.0. However, I don't want to hardcode the R_HOME path because then I would have to update the path in the environment variables each time I load R. Is there a way to get radian to work without hardcoding the R_HOME path in the environment variables?

Here's the error I receive when I do not hardcode the R_HOME path:

Traceback (most recent call last):
  File "C:\Users\itpetersen\AppData\Local\Programs\Python\Python310\Scripts\radian-script.py", line 33, in <module>
    sys.exit(load_entry_point('radian==0.6.3', 'console_scripts', 'radian')())
  File "C:\Users\itpetersen\AppData\Local\Programs\Python\Python310\lib\site-packages\radian\app.py", line 108, in main
    RadianApplication(r_home, ver=__version__).run(options, cleanup=cleanup)
  File "C:\Users\itpetersen\AppData\Local\Programs\Python\Python310\lib\site-packages\radian\app.py", line 205, in run
    rchitect.init(args=args, register_signal_handlers=True)
  File "C:\Users\itpetersen\AppData\Local\Programs\Python\Python310\lib\site-packages\rchitect\setup.py", line 46, in init
    raise Exception(load_lib_error())
Exception: Cannot load shared library: The specified module could not be found.

Per the documentation, I tried to specify the R_HOME manually when running radian, but I receive an error that suggests it doesn't recommend the env function:

env R_HOME=C:/R/R-4.2.0 radian

Here's the error:

env : The term 'env' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ env R_HOME=C:/R/R-4.2.0 radian
+ ~~~
    + CategoryInfo          : ObjectNotFound: (env:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I'm new to radian, so any help would be greatly appreciated. Thanks!

isaactpetersen avatar Aug 01 '22 22:08 isaactpetersen

In Windows command line (Ctrl + r -> CMD.exe): set R_HOME=C:/R/R-4.2.0 should work. If you have R under the Program Files directory use: set R_HOME=%PROGRAMFILES%/R/R-4.2.0

dleather avatar Sep 27 '22 18:09 dleather