Skip to content

Unable to find R executable #285

@braemd

Description

@braemd

Dear all,

When running PsN with generating plots, e.g., -rplots=1, I encountered the error:
Unable to find R executable: C:\Program Files\PsN-5.3.1\R\bin\R not in path? eventhough R.exe was locoated at exactly this location and was even added to the PATH.

This was only the case when I had specified the path to R.exe in the config file (R=../../../../../R/bin/R.exe). When deleting this line and having the path to R.exe in the PATH environment variable, no error occured.

Me unpacking PsN into the "Program Files" folder seems to have been the problem since the system call in the check_R_executable function in rplots.pm seems to strugle with the space in the folder name. I could solve the problem by adjusting the get_R_exec function (line 159) in
...\PsN-5.3.1\strawberry\perl\site\lib\PsN_5_3_1\PsN.pm
and adding quotation marks around the path to the R.exe file from the config file according to:

if (defined $config->{'_'}->{'R'}) {
    $rexec = $config->{'_'}->{'R'};
    $rexec = File::Spec->rel2abs($rexec, $lib_dir);
    $rexec = '"' . $rexec . '"'; #adding quotation marks
}

Not sure if anyone else has ever encountered a similar error when unpacking PsN into a folder with a space in the name or this was a bug specific for my scenario, just wanted to share this fix.

Best regards
Dominic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions