Skip to content
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

Styler cannot be loaded #1079

Closed
grimmjulian opened this issue Dec 13, 2022 · 8 comments
Closed

Styler cannot be loaded #1079

grimmjulian opened this issue Dec 13, 2022 · 8 comments

Comments

@grimmjulian
Copy link

Hello, after installing styler I cannot open it using library() or require().
I get the following error message when trying to load the package:

library(styler)
#> Error: package or namespace load failed for 'styler':
#>  .onLoad failed in loadNamespace() for 'styler', details:
#>   call: system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait, 
#>   error: '/c' not found

Removing and reinstalling results in the same error. Restarting the R Session does not help.

When I used reprex::reprex() to create the following example, I got the following message:

reprex::reprex()
#> ✖ Install the styler package in order to use `style = TRUE`.
#> ℹ Rendering reprex...
#> ✔ Reprex output is on the clipboard.

I use R version 4.2.2 and install the newest styler version in 1.8.1. I couldnt find another package with this problem. Do you have an idea where this bug is coming from?

@MichaelChirico
Copy link
Contributor

are you on Windows? if so it may be necessary to restart the computer before reinstalling

@grimmjulian
Copy link
Author

I am on Windows. I deinstalled styler, restarted the computer and installed it again, but the error is the same...

@lorenzwalthert
Copy link
Collaborator

Can you explicitly deactivate the cache and load the package again?

options("styler.cache_name" = NULL)
library(styler)

@grimmjulian
Copy link
Author

@lorenzwalthert I tried it, also with removing and restarting the computer before reinstalling, but I get the same error...

@lorenzwalthert
Copy link
Collaborator

Very strange. I don’t think I cantaloupe here. Please look for these types of problems on stackoverflow, Google, etc.

@MichaelChirico
Copy link
Contributor

I recommend trying options(error=recover) to get better insight on where the error is triggering. please also provide traceback() of the error.

@grimmjulian
Copy link
Author

I did not know the option you suggested, so sadly I need some more information how to work with it/what to look for. I will look into it, if I have time today and will amend this comment. The traceback resulted in the following:

traceback()
#> 6: stop(msg, call. = FALSE, domain = NA)
#> 5: value[[3L]](cond)
#> 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
#> 3: tryCatchList(expr, classes, parentenv, handlers)
#> 2: tryCatch({
#>        attr(package, "LibPath") <- which.lib.loc
#>        ns <- loadNamespace(package, lib.loc)
#>        env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
#>    }, error = function(e) {
#>        P <- if (!is.null(cc <- conditionCall(e))) 
#>            paste(" in", deparse(cc)[1L])
#>        else ""
#>        msg <- gettextf("package or namespace load failed for %s%s:\n %s", 
#>            sQuote(package), P, conditionMessage(e))
#>        if (logical.return && !quietly) 
#>            message(paste("Error:", msg), domain = NA)
#>        else stop(msg, call. = FALSE, domain = NA)
#>    })
#> 1: library(styler)

@lorenzwalthert
Copy link
Collaborator

Due to inactivity, I think we should close this. It seems not a problem with {styler}, but rather with your R setup.

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

No branches or pull requests

3 participants