question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When setting Python version to 3.10 using runtime.txt, you actually get v3.7

See original GitHub issue

Bug description

Note: This bug was originally surfaced via a help request in gitter.

When you use a runtime.txt file to set the Python version, and request v3.10, you actually get version 3.7 (I suspect the default version r2d is configured to install?)

Expected behaviour

The Python version stated in the runtime.txt file is respected and Python version 3.10 is installed.

Actual behaviour

Instead of 3.10, Python 3.7 is available.

How to reproduce

I created an MWE repo to demonstrate this: https://github.com/sgibson91/pythonv3.10-binder-mwe

  1. Launch the above repo in binder: Binder
  2. Open a Terminal
  3. Execute the command python --version
  4. See result is 3.7.*, not 3.10.*

Alternatively:

  1. Open a new Notebook
  2. Execute the below code in a cell:
import sys
print(sys.version)
  1. See result is 3.7.*, not 3.10.*

Your personal set up

See files in https://github.com/sgibson91/pythonv3.10-binder-mwe for setup details.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
minrkcommented, Sep 6, 2022

As @manics mentioned, this was fixed very recently in repo2docker (#1175), but that update had yet to be deployed to mybinder.org due to https://github.com/jupyterhub/mybinder.org-deploy/issues/2337. That was just fixed and repo2docker updated by merging https://github.com/jupyterhub/mybinder.org-deploy/pull/2336, so the issue for 3.10 in particular should be resolved for both repo2docker and mybinder.org. But image caching means you’ll need to trigger a rebuild by pushing a new commit. This should work, I think: https://gke.mybinder.org/v2/gh/minrk/pythonv3.10-binder-mwe/HEAD

I think we can close this, as #552 already represents the issue of incorrect envs instead of errors for unsupported Python (fixed in #1184)

1reaction
sgibson91commented, Sep 6, 2022
  1. I installed r2d from main using python3 -m pip install https://github.com/jupyterhub/repo2docker/archive/main.zip (into a fresh conda env)
  2. I locally cloned https://github.com/sgibson91/pythonv3.10-binder-mwe
  3. I ran repo2docker . from the repo root
  4. Logs from r2d:
Picked Local content provider.
Using local repo ..
Building conda environment for python=3.10
Using PythonBuildPack builder
Building conda environment for python=3.10
Building conda environment for python=3.10

(Just to note that I saw the same BuildPack logs highlighting v3.10 on Binder but it silently fell back to v3.7)

This time when I ran python --version, I got version 3.10. So this is a binder issue, not a r2d issue. Apologies for the noise! Shall I transfer this issue to the mybinder.org-deploy repo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying a Python Runtime - Heroku Dev Center
To specify a Python runtime, add a runtime.txt file to your app's root directory that declares the exact version number to use:
Read more >
Error while pushing to Heroku: requested runtime is not ...
Yes, the runtime.txt needs to be formatted in a particular way. But the version to use is not whatever you are using locally....
Read more >
Support reading the version from from runtime.txt #530 - GitHub
Resolved runtime.txt as python-3.10.7 Version python-3.10.7 was not found in the local cache Error: Version python-3.10.7 with arch x64 not ...
Read more >
4. Using Python on Windows — Python 3.11.1 documentation
This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix...
Read more >
What's New In Python 3.10 — Python 3.11.1 documentation
Release, 3.11.1,, Date, December 20, 2022,, Editor, Pablo Galindo Salgado,. This article explains the new features in Python 3.10, compared to 3.9.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found