# Error in mybinder.org: there is no package called ‘IRkernel’

**URL:** <https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478>\
**Category:** Binder\
**Tags:** help-wanted\
**Created:** [February 5, 2025, 10:49am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478 "2025-02-05T10:49:18Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 5, 2025, 10:49am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/1 "2025-02-05T10:49:18Z")

</div>

Hello,  
I managed to create a Binder and was able to launch it. However, now after some time I was trying to rebuild it and struggle with the following error. Does anyone have an idea? The IRkernel package is not coming from my specification.  
.binder files: [aquainfra-usecase-Daugava/.binder at containerize · AstraLabuce/aquainfra-usecase-Daugava · GitHub](https://github.com/AstraLabuce/aquainfra-usecase-Daugava/tree/containerize/.binder)  
Binder: [Binder](https://mybinder.org/v2/gh/AstraLabuce/aquainfra-usecase-Daugava/containerize)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/3X/7/0/7066437f2997dad56d770dae871c62274bfc0f53.png)

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [February 5, 2025, 2:23pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/2 "2025-02-05T14:23:26Z")

</div>

It looks like you based your approach on [here](https://github.com/binder-examples/r). If you [click here to try to launch from there](https://mybinder.org/v2/gh/binder-examples/r/master?filepath=index.ipynb), you’ll see the example encounters the same thing.  
So for now, this way isn’t working. I don’t have time to look around on this forum right now, but I thought this was pointed out a few weeks or months ago. (It may have been related to use of ‘Shiny’?) If so, looking there may offer you more insight.

If you go to the section [‘Specifying an R environment with a runtime.txt file’](https://mybinder.readthedocs.io/en/latest/examples/sample_repos.html#specifying-an-r-environment-with-a-runtime-txt-file) of the ’ Sample Binder Repositories’ documentation page in the Binder User guide, you’ll see there is a note warning against using that as a basis." We recommend to follow [r-conda](https://github.com/binder-examples/r-conda) instead." That leads to [here](https://github.com/binder-examples/r-conda).  
And I can attest that currently works well to get an R kernel as it both [works in launches from the guide version](https://github.com/binder-examples/r-conda) (see note below though) and [works here in launches from my repo](https://github.com/fomightez/SICILIAN-binder) based on it.  
**Note: With the r-conda demo site [there is an issue with the example ‘Jupyter + R’ that I have asked to be fixed](https://github.com/binder-examples/r-conda/issues/7).**

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [February 5, 2025, 4:43pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/3 "2025-02-05T16:43:29Z")

</div>

Sorry, it was Dash that was the issue [here](https://discourse.jupyter.org/t/ongoing-binder-issues/32116/6). So what I was thinking of didn’t involve that repo using runtime to run R.

Looking at your repo though it looks like you can possibly convert it to using `environment.yml` with guidance from my last post?

* * *

* * *

I know it doesn’t pertain to OP, yet because I raised ‘Shiny’ in this thread though, for the sake of others getting here:  
Sorry, it was Dash that was the issue [here](https://discourse.jupyter.org/t/ongoing-binder-issues/32116/6). Not Shiny.

I had though raised issues about Shiny a long time ago [here](https://discourse.jupyter.org/t/r-shiny-app-on-mybinder-launch-attempt-failing/19034/2). I don’t know if it ever was workin in the interim there.

I will point out in regards to Shiny presently, there is [py.cafe](https://py.cafe/). It says ‘Shiny for Python’ though and I don’t know how easy the conversions are though.

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [February 5, 2025, 6:41pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/4 "2025-02-05T18:41:42Z")

</div>

There are a few pending repo2docker PRs related to R  
[https://github.com/jupyterhub/repo2docker/pulls](https://github.com/jupyterhub/repo2docker/pulls)  
Mostly waiting on someone to build and run the PR to confirm it’s working as expected since we don’t have any UI tests for Rshiny or Rstudio.

---

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 6, 2025, 12:25pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/5 "2025-02-06T12:25:29Z")

</div>

Thanks so far! I am currently trying to convert it to an environment.yml but struggle with some version conflicts because of r-terra, which comes in version 1.7-46 though 1.8.5 is required by the library mapview. Anyway, I will keep trying.

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [February 6, 2025, 1:08pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/6 "2025-02-06T13:08:55Z")

</div>

I just looked at a version you had updated 5 minutes ago (this one [here](https://github.com/AstraLabuce/aquainfra-usecase-Daugava/blob/b8b5d2e179d671d6f582fd5b1bc3fe9fa6036d5e/.binder/environment.yml) I believe).  
A couple of things:

- Ideally, do not pin things at the outset. Or at least keep it to minimum. Let conda sort it out. Only pin once you determine a combination that works & only if you are sure you’ll need it. It may be best to at least just record the combination that works so you can recover later if things change out of sync, as sometimes happens.
- I also thought you couldn’t have `defaults` there under channel anymore and have it build completely? [That was the case when I had investigated here](https://discourse.jupyter.org/t/encountering-resource-limits-when-building-binder-from-repo-returned-a-non-zero-code-137/28284/2). Or at least [it is definitely not recommended](https://discourse.jupyter.org/t/fresh-install-of-jupyterlab-from-conda-forge-is-version/20990/2).

You can still install with R if that helps you in your case, too. My repo has an example [where I use an R script to install a library as well](https://github.com/fomightez/SICILIAN-binder/tree/master/binder).

---

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 6, 2025, 1:36pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/7 "2025-02-06T13:36:38Z")

</div>

Alright, I think I am one step further. I removed the versions and defaults from the [env.yml](https://github.com/AstraLabuce/aquainfra-usecase-Daugava/blob/64ff2011b4c8e11d5889dbcf0370fde457124949/.binder/environment.yml). It’s just strange that the libs mapview and tmap don’t work as they expect r-terra\>=1.8.5.  
If I install mapview locally, it installs r-terra=1.8.15 but when I install r-tmap afterwards, it wants to downgrade r-terra to 1.7\_83, although it also actually requires 1.8.5. I will continue playing a bit with the env.yml :).

---

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 7, 2025, 9:25am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/8 "2025-02-07T09:25:58Z")

</div>

So, I couldn’t find a solution and start believing that there is a more fundamental compatibility problem. If I don’t set r-terra to 1.8.\_15, it installs 1.7\_sth. and if I set the version, it cannot resolve the compatibility issue. Strange though.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/3X/b/0/b0f91c2c8fc559b254506309c1b7ea11d031560a.png)

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [February 7, 2025, 2:00pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/9 "2025-02-07T14:00:44Z")

</div>

Sorry. I don’t know what to suggest for that issue. Since it is offered in conda-forge, I wonder if you could learn what combination may work by using Anaconda Cloud?

---

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 7, 2025, 2:50pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/10 "2025-02-07T14:50:02Z")

</div>

I understand that environment.yml is the recommended way, but do I get it right that runtime.txt + install.R is not going to work anymore at all? Or is this a temporary issue that will be fixed? I also tried some other Binders that used runtime.txt and they also didn’t work. So, all Binders using runtime.txt will need to convert?  
Thanks so far for your suggestions!

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [February 7, 2025, 4:02pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/11 "2025-02-07T16:02:14Z")

</div>

You’d have to look into the details that @manics posted above. All I know is that the runtime approach hasn’t worked for a while now and the recommended way is with conda. You also may want to check out [Jupyter’s Zulip](https://jupyter.zulipchat.com/) to maybe see what was discussed there and get more input.

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [February 18, 2025, 6:45pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/12 "2025-02-18T18:45:16Z")

</div>

Sorry you’re having issues, @MarkusKonkol. Our unit and integration tests for `runtime.txt` do pass, so I opened [Investigate potential issues with our `runtime.txt` implementation for R · Issue #1415 · jupyterhub/repo2docker · GitHub](https://github.com/jupyterhub/repo2docker/issues/1415) to try to investigate what the issues are.

If you (and perhaps @fomightez?) could link to some repos that are currently failing, that would help identify issues and see what needs to be fixed.

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [February 18, 2025, 9:31pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/13 "2025-02-18T21:31:47Z")

</div>

> [@yuvipanda](#):
>
> some repos that are currently failing

I was trying [Binder Examples repo: ‘Specifying an R environment with a runtime.txt file’](https://github.com/binder-examples/r).

> **[GitHub - binder-examples/r: Using R with Jupyter / RStudio on Binder](https://github.com/binder-examples/r)**
>
> Using R with Jupyter / RStudio on Binder

I just tried to launch a session from that repo again right now and it gave the same issue. Build fails with:

```plaintext
...
> install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv("EXPANDED_CRAN_MIRROR_URL"))
Installing packages into ‘/srv/rlibs’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://packagemanager.posit.co/all/ __linux__ /jammy/2024-01-10+kZwhsmgb/src/contrib:
  cannot open URL 'https://packagemanager.posit.co/all/ __linux__ /jammy/2024-01-10+kZwhsmgb/src/contrib/PACKAGES'
> 
> 
Warning message:
packages ‘devtools’, ‘IRkernel’, ‘shiny’ are not available for this version of R

Versions of these packages for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 
> IRkernel::installspec(prefix=Sys.getenv("NB_PYTHON_PREFIX"))
Error in loadNamespace(x) : there is no package called ‘IRkernel’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
 ---> Removed intermediate container ed72fee468b9
The command '/bin/sh -c export EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo https://packagemanager.posit.co/all/ __linux__ /${VERSION_CODENAME}/2024-01-10+kZwhsmgb | envsubst)" && R --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv(\"EXPANDED_CRAN_MIRROR_URL\"))" && R --quiet -e "IRkernel::installspec(prefix=Sys.getenv(\"NB_PYTHON_PREFIX\"))"' returned a non-zero code: 1Error in event stream: Error

```

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [February 18, 2025, 9:43pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/14 "2025-02-18T21:43:15Z")

</div>

ty @fomightez! I’ve opened [Add a test for runtime.txt with full R version specified by yuvipanda · Pull Request #1416 · jupyterhub/repo2docker · GitHub](https://github.com/jupyterhub/repo2docker/pull/1416) to add a test with that runtime.txt, let’s see if that fails! If it does that should allow us to figure out how to fix it.

---

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 20, 2025, 6:44am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/15 "2025-02-20T06:44:35Z")

</div>

Thanks for looking into this! In case you need another example, feel free to check this one: [GitHub - AstraLabuce/aquainfra-usecase-Daugava at 48f0485ef513f7271f472e09c2e2d2b629ecf58c](https://github.com/AstraLabuce/aquainfra-usecase-Daugava/tree/48f0485ef513f7271f472e09c2e2d2b629ecf58c). In the meantime I changed the dependencies to conda, but in that commit you will find runtime.txt/install.R.

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [February 20, 2025, 10:58pm UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/16 "2025-02-20T22:58:26Z")

</div>

Ty @MarkusKonkol too!

I am investigating, as the PR I opened now succeeds, _and_ repo2docker running locally on my machine works!

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [February 21, 2025, 12:19am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/18 "2025-02-21T00:19:23Z")

</div>

It looks like something is blocking connections from binder to [packagemanager.posit.co](http://packagemanager.posit.co)! Let me poke around to see what that may be.

Fascinating. So connecting to [packagemanager.posit.co](http://packagemanager.posit.co) (but _not_ to [posit.co](http://posit.co) or other things) fails _only_ when run within a docker build, and nowhere else. not during docker run, not from kubernetes pod, nor from the host.

With the following dockerfile:

```Dockerfile
FROM buildpack-deps:24.04

RUN curl -vvv "https://packagemanager.posit.co/" -o water
RUN head water

```

This command fails on the mybinder, when run from inside the dind container:

```auto
$ docker buildx build --progress=plain -t wat .
[...]
#5 [2/3] RUN curl -vvv "https://packagemanager.posit.co/" -o water
#5 0.279 % Total % Received % Xferd Average Speed Time Time Time Current
#5 0.279 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host packagemanager.posit.co:443 was resolved.
#5 0.293 * IPv6: (none)
#5 0.293 * IPv4: 3.147.162.64, 3.132.14.200, 18.221.183.63
#5 0.293 * Trying 3.147.162.64:443...
#5 0.402 * Connected to packagemanager.posit.co (3.147.162.64) port 443
#5 0.405 * ALPN: curl offers h2,http/1.1
#5 0.405 } [5 bytes data]
#5 0.405 * TLSv1.3 (OUT), TLS handshake, Client hello (1):
#5 0.405 } [512 bytes data]
#5 0.444 * CAfile: /etc/ssl/certs/ca-certificates.crt
#5 0.444 * CApath: /etc/ssl/certs
  0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0^C

```

eventually timing out after 5min

However, `docker buildx build --progress=plain -t wat --network=host .` **immediately** succeeds.

But this is _only_ an issue for [packagemanager.posit.co](http://packagemanager.posit.co). Every other website works just fine.

So this is some cursed network situation we need to figure out!

Update: I’ve made more progress! By creating a docker buildkit builder of type docker-container, I’m able to exec into it and reproduce this behavior.

So it’s some networking thing in the buildkit layer that’s causing this 😑

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [February 21, 2025, 1:22am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/19 "2025-02-21T01:22:55Z")

</div>

@MarkusKonkol @fomightez success! This was not an issue in repo2docker (so the tests didn’t catch it), but an issue at the tcp/ip layer on docker’s default configuration in a specific set of circumstances interacting with posit packagemanager’s edge node configuration… after a lot of digging, I’ve fixed it now with [Explicitly set docker's MTU to 1450 by yuvipanda · Pull Request #3235 · jupyterhub/mybinder.org-deploy · GitHub](https://github.com/jupyterhub/mybinder.org-deploy/pull/3235)! I definitely feel like I fought the computer today and won 🙂

Both the binder-examples/r repo and the AstraLabuce repo work now on mybinder \o/

Thank you for reporting it, and thank you for being patient as I debugged this complex infrastructure (than software) issue!

---

<div class="post-metadata">

**Author:** ![MarkusKonkol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markuskonkol/32/6854_2.png) [@MarkusKonkol](https://discourse.jupyter.org/u/MarkusKonkol)\
**Post date:** [February 21, 2025, 7:53am UTC](https://discourse.jupyter.org/t/error-in-mybinder-org-there-is-no-package-called-irkernel/32478/20 "2025-02-21T07:53:25Z")

</div>

I can confirm that it’s working. Great job, thanks!
