cmdstanr icon indicating copy to clipboard operation
cmdstanr copied to clipboard

Cannot import cmdstanr in my package

Open marouenbg opened this issue 6 months ago • 2 comments

Describe the bug I am using cmdstanr in my R package (called netZooR) as a dependency and I added in my DESCRIPTION file as follows: Remotes: stan-dev/cmdstanr,

However, I get this error "Error in loadNamespace(x) : there is no package called ‘cmdstanr’" I also have 2 other packages in my remotes, and those work perfectly fine and are able to load.

To Reproduce devtools::install_github("netZoo/netZooR", build_vignettes = TRUE) library(netZooR)

Expected behavior To have cmdstanr install and load as a remote package

Operating system Ubuntu 22.04

CmdStanR version number 0.9

marouenbg avatar Aug 18 '25 17:08 marouenbg

Thanks for reporting this. I will try to look into this when I have a chance, but I'm a bit overloaded at the moment. For now, have you tried what brms does? It has cmdstanr in Suggests and instead of the Remotes field it uses Additional_repositories with https://stan-dev.r-universe.dev/ instead of stan-dev/cmdstanr. I think what you did should work too, but until we figure out why it's not working can you try copying brms and checking if that works? Here's the DESCRIPTION file:

https://github.com/paul-buerkner/brms/blob/0e821e664395c25de8a06fe4bb84fa35cfe4dcc8/DESCRIPTION#L108-L109

jgabry avatar Aug 18 '25 17:08 jgabry

Thanks @jgabry. cc @taraeicher, I will try that and report back!

marouenbg avatar Aug 18 '25 17:08 marouenbg