Skip to content

Error when committing #169

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

Closed
fschoner opened this issue May 4, 2020 · 10 comments
Closed

Error when committing #169

fschoner opened this issue May 4, 2020 · 10 comments

Comments

@fschoner
Copy link

fschoner commented May 4, 2020

After updating to R 4.0, I keep receiving the following error when trying to commit

style-files..............................................................Failed

  • hook id: style-files
  • exit code: 1
    Fehler in loadNamespace(name) : es gibt kein Paket namens 'docopt'
    Ruft auf: :: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
    Ausführung angehalten

lintr....................................................................Failed

  • hook id: lintr
  • exit code: 1

Fehler in loadNamespace(name) : es gibt kein Paket namens 'docopt'
Ruft auf: :: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Ausführung angehalten

This occurs even though I have installed docopt on all
.libPaths()
Any idea what goes wrong?

@lorenzwalthert
Copy link
Owner

Well, as you described and as described in the README, install.packages('docopt') should do. Try removing and re-installing? Did dyou set .libPaths() in .Rprofile?

@fschoner
Copy link
Author

fschoner commented May 4, 2020

Did not help. No, I did not set .libPaths() in .Rprofile

@lorenzwalthert
Copy link
Owner

So the hooks runs this script. Can you download, put it in your working directory and run

chmod 744 style-files
./style-files file1.R

where file1.R is the path to an R file to style?

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented May 4, 2020

You can also use pre-commit try-repo when you cloned {precommit}, edit the script (e.g. add a print(.libPahts()) to the styler hook) and run the hook interactively as described here.

@fschoner
Copy link
Author

fschoner commented May 5, 2020

Fixed it. I didn't have the most recent version of precommit in the environment file. Can be closed.

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented May 5, 2020

Which file? I don't see why this should matter.

@fschoner
Copy link
Author

fschoner commented May 5, 2020

My own environment.yml.

@lorenzwalthert
Copy link
Owner

the one for conda?

@fschoner
Copy link
Author

fschoner commented May 5, 2020

Yes

@lorenzwalthert
Copy link
Owner

Ok. I don't see how this is related but we can close the issue anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants