Comments (11)
Many times working in a OneDrive directory is not good.
from rethinking.
Yeah, my guess too is that OneDrive is the problem, given the error message. But I have no experience with OneDrive.
from rethinking.
Thanks. I moved the cmdstan file to a local drive then change the path with set_cmdstan_path(), but I got the same error message. I guess R keeps looking in OneDrive. Still trying to figure out how to fix that.
from rethinking.
If you just moved the files, that won't work most likely, you need to rebuild cmdstan.
I would actually just run
cmdstanr::install_cmdstan(dir = "THE_NON_ONEDRIVE_DIRECTORY")
And run that. If that does not help, please let me know and we can debug further.
from rethinking.
Also make sure to set your work directory to a dir outside OneDrive (I use setwd()
in an R terminal)
from rethinking.
Thank you. I really appreciate your help. I ran
cmdstanr::install_cmdstan(dir = "THE_NON_ONEDRIVE_DIRECTORY")
And got the same error. Here's more details on the error. I don't know enough about R to decipher it. I can't tell if the error is originating in rethinking then flowing down. Honestly, I don't know what's going on.
Error in (function (command = NULL, args = character(), error_on_status = TRUE, …:
! System command 'make' failed
Exit status: 2
Stderr:
make: *** /c/Users/lbarnes/OneDrive: Is a directory. Stop.
Backtrace:
- rethinking::ulam(alist(log_gdp_std ~ dnorm(mu, sigma), mu <- a[cid] + b[cid] …
- cmdstanr::cmdstan_model(stan_file = filex[[1]], compile = filex[[3]], cpp_o…
- CmdStanModel$new(stan_file = stan_file, exe_file = exe_file, …
- local initialize(...)
- self$compile(...)
- cmdstanr:::get_cmdstan_flags("STANCFLAGS")
- cmdstanr:::wsl_compatible_run(command = "make", args = c(paste0("print-", …
- base::do.call(processx::run, run_args)
- (function (command = NULL, args = character(), error_on_status = …
- processx:::throw(new_process_error(res, call = sys.call(), echo = echo, …
from rethinking.
This behavior looks a lot like the one I just posted, except I'm not using OneDrive and my Cmdstan path is set to:
/Users/bardolater/.cmdstan/cmdstan-2.31.0
from rethinking.
@bardolater I guess you've done cmdstanr::install_cmdstan(overwrite=TRUE)
?
@Lawbarnes have you asked about this at https://discourse.mc-stan.org?
from rethinking.
from rethinking.
Hello, I'm a coding novice and have a similar problem to Lawbarnes that I would really appreciate help with. Everything was going smoothly until R code 9.14. I've tried many different solutions posted online, including reinstalling Rstan and CmdStanR many different ways, but still no success, although the errors I get when running code 9.14 have evolved. I'm running R version 4.3.0 in Windows 11. Below is a brief summary of some of the errors I have gotten and solutions I have tried. Thanks in advance!
1st error: could not find function "ulam"
Installing Rstan via the code below (from https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows) seemed to fix this:
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
2nd error: CmdStan path has not been set yet. See ?set_cmdstan_path.
After trying different ways of installing CmdStanR the error changed to...
3rd error: Can't find CmdStan makefile to detect version number. Path may not point to valid installation.
After trying still other ways of installing CmdStanR the error changed to...
4th error: Rtools42 was not found but is required to run CmdStan with R version 4.3.0.
Please install Rtools42 and run cmdstanr::check_cmdstan_toolchain().
Then I added the following to PATH under System Variables:
C:\rtools43
C:\rtools43\mingw64\bin
C:\rtools43\usr\bin
C:\Users\z3389438\AppData\Local\R\win-library\4.3\cmdstanr\cmdstan-2.32.2
C:\Users\z3389438\AppData\Local\R\win-library\4.3\cmdstanr\cmdstan-2.32.2\stan\lib\stan_math\lib\tbb
And I ran the following in Rtools43 Bash (from https://discourse.mc-stan.org/t/problem-installing-cmdstan-with-r4-2-and-rtools42/28846/5)
rm -rf /var/cache/pacman/pkg/*
rm -r /etc/pacman.d/gnupg/
pacman-key --init
pacman-key --populate msys2
pacman -S msys2-keyring
pacman -Syyu
pacman -Sy mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-gcc
pacman -Syu mingw-w64-x86_64-make
5th error: Compiling Stan program...
Error in process_initialize(self, private, command, args, stdin, stdout, …
:
! Native call to processx_exec
failed
Caused by error in chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …
:
! Command 'mingw32-make.exe' not found @win/processx.c:982 (processx_exec)
Type .Last.error to see the more details.
.Last.error
<c_error/rlib_error_3_0/rlib_error/error>
Error inprocess_initialize(self, private, command, args, stdin, stdout, …
:
! Native call toprocessx_exec
failed
Caused by error inchain_call(c_processx_exec, command, c(command, args), pty, pty_options, …
:
! Command 'mingw32-make.exe' not found @win/processx.c:982 (processx_exec)
Backtrace:
- rethinking::ulam(alist(log_gdp_std ~ dnorm(mu, sigma), mu <- a[cid] + b[cid] * …
- cmdstanr::cmdstan_model(stan_file = filex[[1]], compile = filex[[3]], cpp_options = cpp_options, …
- CmdStanModel$new(stan_file = stan_file, exe_file = exe_file, …
- local initialize(...)
- self$compile(...)
- withr::with_path(c(toolchain_PATH_env_var(), tbb_path()), run_log <- wsl_compatible_run(com…
- base::force(code)
- cmdstanr:::wsl_compatible_run(command = make_cmd(), args = c(wsl_safe_path(tmp_exe), …
- base::do.call(processx::run, run_args)
- (function (command = NULL, args = character(), error_on_status = TRUE, …
- process$new(command, args, echo_cmd = echo_cmd, wd = wd, windows_verbatim_args = windows_ve…
- local initialize(...)
- processx:::process_initialize(self, private, command, args, stdin, stdout, …
- processx:::chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …
- | base::withCallingHandlers(do.call(".Call", list(.NAME, ...)), error = function(e) { …
- | base::do.call(".Call", list(.NAME, ...))
- | base::.handleSimpleError(function (e) …
- | local h(simpleError(msg, call))
- | processx:::throw_error(err, parent = e)
from rethinking.
I found a solution to this problem caused by institutional use of OneDrive over at the Stan forums [https://discourse.mc-stan.org/t/system-command-make-failed-models-wont-compile/30528/18?u=stashlee00]. All I needed to do was delete the empty folder that starts with “OneDrive”:
C:\Users\first-last\OneDrive (I deleted this one which was empty)
C:\Users\first-last\OneDrive - MMC (This one had OneDrive files in it - I did not delete it)
from rethinking.
Related Issues (20)
- How to construct a spline model using ulam() HOT 4
- cannot install rethinking HOT 1
- Error in link(), R code 4.67 HOT 1
- Poisson response imputation compilation error
- Random Effect in Zero-Inflated Model
- Rethink package is NOT getting installed HOT 8
- Sampling issue for the Cat Adoptions Survival model.
- Random walk in ulam HOT 2
- problem in precis command
- Can multiple outcomes be regressed on the same linear model?
- ulam fits missing @stanfit slot? HOT 2
- WAIC not computing from ulam() model, even with log_lik = TRUE HOT 4
- Problem installing cmdstanr HOT 1
- ulam fits giving odd errors HOT 4
- errata 2nd Edition page 130
- log_lik fails with matrices in models fit by ulam HOT 6
- Where is sim_globe, and the rest of the code shown in the videos? HOT 2
- Panda_nuts Nut-Cracking Frequency? HOT 6
- The garden of forking data - 2 blue from 1? HOT 3
- quap allows incorrect(?) definition with categorical variable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rethinking.