# Can't (re)install Stan on macOS Monterey: "dependency ‘parallel’ is not available"

**URL:** <https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317>\
**Category:** RStan\
**Tags:** installation\
**Created:** [February 12, 2022, 11:49pm UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317 "2022-02-12T23:49:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssickels](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ssickels/32/12992_2.png) [@ssickels](https://discourse.mc-stan.org/u/ssickels)\
**Post date:** [February 12, 2022, 11:49pm UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/1 "2022-02-12T23:49:54Z")

</div>

Just upgraded from Big Sur to Monterey (macOS 12.2.1). And can’t get RStan (re)installed. Per “[RStan getting started](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started),” I tried, first,

> remove.packages(“rstan”)  
> if (file.exists(“.RData”)) file.remove(“.RData”)

And then,

> Sys.setenv(DOWNLOAD\_STATIC\_LIBV8 = 1) # only necessary for Linux without the nodejs library / headers  
> install.packages(“rstan”, repos = “[https://cloud.r-project.org/](https://cloud.r-project.org/)”, dependencies = TRUE)

Which yields the following error message:

> Warning in install.packages :  
> dependency ‘parallel’ is not available  
> trying URL ‘[https://cloud.r-project.org/bin/macosx/contrib/4.1/rstan\_2.21.3.tgz](https://cloud.r-project.org/bin/macosx/contrib/4.1/rstan_2.21.3.tgz)’  
> Content type ‘application/x-gzip’ length 24540870 bytes (23.4 MB)  
> ==================================================  
> downloaded 23.4 MB

Then, when I run the suggested code to verify the installation,

> example(stan\_model, package = “rstan”, run.dontrun = TRUE)

I get the following:

> Error: package or namespace load failed for ‘rstan’:  
> package ‘parallel’ does not have a namespace  
> Called from: value[3L]

But per [this documentation](https://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf), parallel has been in r-core since 2.14.0 (?). Yet, it looks like R is nonetheless complaining that it’s missing.

I tried using, instead, `dependencies = FALSE`:

> Sys.setenv(DOWNLOAD\_STATIC\_LIBV8 = 1) # only necessary for Linux without the nodejs library / headers  
> install.packages(“rstan”, repos = “[https://cloud.r-project.org/](https://cloud.r-project.org/)”, dependencies = FALSE)

But I still get the same error message when I run the verification code.

So I’m stuck. Suggestions?

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [February 12, 2022, 11:56pm UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/2 "2022-02-12T23:56:27Z")

</div>

What output do you get if you run:

```nohighlight
install.packages("parallel")

```

---

<div class="post-metadata">

**Author:** ![ssickels](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ssickels/32/12992_2.png) [@ssickels](https://discourse.mc-stan.org/u/ssickels)\
**Post date:** [February 13, 2022, 12:15am UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/3 "2022-02-13T00:15:14Z")

</div>

@andrjohns, I get:

> Warning in install.packages :  
> package ‘parallel’ is not available for this version of R  
> A version of this package for your version of R might be available elsewhere,  
> see the ideas at  
> [R Installation and Administration](https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages)

And I’m running version 4.1.2.

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [February 13, 2022, 12:19am UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/4 "2022-02-13T00:19:31Z")

</div>

And if you just run:

```r
library(parallel)

```

---

<div class="post-metadata">

**Author:** ![ssickels](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ssickels/32/12992_2.png) [@ssickels](https://discourse.mc-stan.org/u/ssickels)\
**Post date:** [February 13, 2022, 1:09am UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/5 "2022-02-13T01:09:17Z")

</div>

> Error in library(parallel) : ‘parallel’ is not a valid installed package  
> Called from: library(parallel)

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [February 13, 2022, 1:56am UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/6 "2022-02-13T01:56:47Z")

</div>

That suggests an issue with your R installation itself, since the `parallel` package is bundled as part of the install. Can you try reinstalling R and then seeing if the `parallel` package loads?

---

<div class="post-metadata">

**Author:** ![ssickels](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ssickels/32/12992_2.png) [@ssickels](https://discourse.mc-stan.org/u/ssickels)\
**Post date:** [February 13, 2022, 2:16am UTC](https://discourse.mc-stan.org/t/cant-re-install-stan-on-macos-monterey-dependency-parallel-is-not-available/26317/7 "2022-02-13T02:16:02Z")

</div>

@andrjohns That did it!! Many thanks for helping me out. :-)
