-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rscript not found #441
Comments
Did you run |
Before filing a bug
Describe the bug Additional context
|
To me, this looks suspicious:
I.e. is pre-commit shortening the path to the executable somewhere and then you have a string with a bunch of |
Plus the direction of the slashes changes: First forward, than backward slashes... |
Yes it is, because the actual path is |
A small update: The problem is only present if I use this repo. If I remove it from the hooks, I can use precommit without problems. Hopefully this helps. |
What is this repo? Do you mean if you put |
Just to confirm? Are you using {renv}, as indicated in the issue description? Are you using pre-commit from inside RStudio or from where? |
Yes exactly. And I am using renv. |
From inside RStudio? |
Yes, from inside RStudio. |
Can you try outside of RStudio |
Same error. |
Can you set the environment variable export R_HOME=/path/to/r/home Because pre-commit then appends "/bin/Rscript" to |
If that works, we know that your env variable |
I've set it, re-installed everything, still not working |
So the error message is the same? |
I think your problem is not specific to this repo, but more of an upstream pre-commit problem. I would like to help you debugging the problem but I don't have a windows machine available. I recommend you create a minimal reproducible example in a repo that does not use {renv} and post it upstream. |
Maybe also relevant:
I.e. maybe a path containing |
alternatively, can you unset set FOOBAR= No need to re-install anything. Because then, you should just get |
Yes, the error message is still the same when I set R_HOME, as well when I unset it. Also, in R, global options, R version, I have selected the path without the Thank you for trying to help |
@EzicJ someone else raised the issue and I am confident that we'll solve it over in pre-commit/pre-commit#2599. |
@EzicJ version |
Thank you for the information, unfortunately, after updating to v2.21.0 (and also clearing cache, re-installing, trying in different projects) now when I want to include the R pre-commit repo in the yaml, this is the error message
|
Ok I don't get that. Because clearly, in the source code, the word never is in quotes. Maybe still some problem with the slashes in the executable (
Just to see if it's worth re-raising that in the upstream repo? |
Is anyone else still having this issue? Hope i'm not hijacking the issue thread, but seems the same. After doing the precommit setup and trying to commit a minor commit, i run into the issues described below. I have:
I'm pretty stumped now--is there anything else I can try or more info i can provide to help on debugging? Happy to play guinea pig, though I'm very new to pre-commit. `
|
Thanks @wtimmerman-fitp for offering to play guinea pig. Appreciate it. This seems an annoying problem indeed.
Can you post the warnings here anyways? Because as your error message says, the executable Do you use the hooks inside a project that uses {renv} or not? |
Long story short, same errors appearing. Responding on your points:
🤦♂️ yes that makes sense.
I reinstalled into a random conda env just to get all of the original path warnings to show up, here they are (note that in practice i am suing python 3.9.1 outside a conda env). Bolded what looks relevant. WHen i googled about this earlier i didn't see anything about changing PATH in the docs or online, so i let it be without monkeying with it. Maybe something for the docs for newbies.
and got
I didn't put it first on path, but given that the install works, seems okay.
Yes, indeed. Not sure if i hallucinated you asking, but yes, using Windows. |
Thanks. And where is your Rscript executable located? I.e. on Unix, I would do |
I did but edited after I realised your output shows that already. 🙃 |
Bingo!
Looks like it was an R path issue. I still get some other errors when running the hooks, but I think I see what the issue is on those. I think I might suggest some updates to the R documentation in a few ways for bumbling people like me, will file as a separate issue or pull request later this week. Not sure if this solves @EzicJ 's original issue, but I think I'm in okay shape now. Thank you again for the quick response and help, really looking forward to using this. |
Cool. Yes, if you could help improving the docs with your experience, I'd be all ears for it. Looking forward to a PR and thanks for the persistence. |
@wtimmerman-fitp if you are still interested in help updating the docs, I'd really appreciate it. |
Ah, thank you for the nudge and reminder. The perils of people on the internet offering help. I actually do have time for this this week, will keep you updated. |
The quoting issue about “never not found”should be fixed with the latest pre-commit release. Can you install that release, |
I close this since it has become quite convoluted. Please open a new issue if you still find a problem. @wtimmerman-fitp last reminder for your docs improvement suggestion regarding 'R has to be on the path'. |
I have a problem when I want to commit after activating precommit with
use_precommit()
I have the latest version, did the autoupdate, everything described here: https://lorenzwalthert.github.io/precommit/articles/precommit.html
My .pre-commit-config.yaml is the default one created after executing
use_precommit()
The log file is as follows:
The executable Rscript in the named folder is present, I checked manually
Thank you for your time!
The text was updated successfully, but these errors were encountered: