Can you upgrade python to latest version

Hi @simonw, welcome to the Glitch forum!

Upgrading python to a better-supported version is high on our list of packages to update when we release our next container update, and we know it’s important to a lot of y’all too. We’re actively working on it, and hope to be able to release it “soon”, although I can’t guarantee any particular timeline.

Sorry for the inconvenience!

2 Likes

+1 on python3.6+ support! To add to what @simonw said, any package that uses in-code typehints or f-strings won’t work on 3.5, both of which are frequently used in new python packages.

(Also, i learned that glitch supports python from a @simonw datasette tweet, so +1 to helping him share more features & spread the word!)

1 Like

I’m still trying to make asyncio HTTP requests from Glitch - I thought I could do it by switching from http3 to aiohttp - but I just found out that aiohttp requires 3.5.3 at least: https://aiohttp.readthedocs.io/en/stable/faq.html#why-is-python-3-5-3-the-lowest-supported-version - and Glitch is running 3.5.2!

The quest continues.

2 Likes

I got my stuff working! I ended up having to roll my own asyncio HTTP request function because none of the existing libraries for that support Python 3.5.2 - details here: https://github.com/simonw/datasette-auth-github/pull/40

2 Likes

I have aiohttp working on Glitch. aiohttp==2.3.10

Hey,

Just pitching in that I also think adding 3.6 compatibility would be a real killer improvement for running Python apps on Glitch.

3.6 introduced inline type hints along with other now widely-used syntax additions such as f-strings. As a result, a lot of modern libraries and projects can’t be used below 3.6.

My personal use case is a Starlette demo app which I can’t get to run on 3.5.

Do you guys have any timeline visibility on when Python containers are going to be upgraded?

Thanks!

Hello @florimondmanca, we don’t have an estimate of when our next container update will be released, but updating Python is high on the list of changes we hope to make when we do release an update; sorry for the delay!

I don’t know that we can help getting your project running on Python 3.5, but I can’t find a project there if you did want someone to take a look.

1 Like

Yeah some modules like discord.py (a main module I use for my projects) only have support for 3.5 with the older versions of the module. Using the updated version requires 3.6+ so Ive been using other services for the time being to host my projects, when python 3.6 support is released Ill be sure to move it all over as the glitch site is way better organised and doesnt require me to use sites like GitHub to host my code.

2 Likes

Not piling in, but I’m also seeing this too. (Not as a Glitch user, but as someone wanting to make sure my packages are supported on Glitch. :smiley:)

The latest Python ‘websockets’ package just dropped 3.5 support, which means I’m probably also dropping 3.5 support from the ‘uvicorn’ webserver. There’s a few corners of the Python ecosystem that’re still supporting it (eg. aiohttp), but for anything using async it’s generally 3.6+ since there’s some big pain points associated with attempting to support 3.5. (Eg. no async generators.)

Also worth noting that EOL for security updates to 3.5 is only 12 months away now… https://devguide.python.org/#status-of-python-branches

Hiya @tomchristie, welcome to the Glitch forum and thanks for the additional context!

Vote for 3.7, as the minimal python version :wink:

3 Likes

I think this has happened! I just launched a new Glitch project and it appears to have Python 3.7.5!

1 Like

Yeah! We only updated it earlier this week and have been monitoring how it’s going before widely saying anything - do let us know if you encounter any unexpected issues!

1 Like

I’m getting an error right now when running “pip3 install datasette --user” - which worked before.

Looks like the problem is the httptools dependency which is trying to compile a C dependency, but failing because the Python.h header file (usually installed using “apt-get install python3-dev”) isn’t available.

I’ve passed this onto the infrastructure folks and they’re currently deploying a change that installs python3-dev

That fixed the issue! “pip3 install datasette --user” now succeeds in installing all the dependencies!

I’m running into a different problem however: is there any reason the new environment might use up more disk space? I’m getting “184MB / 194MB” for a pretty new project after installing those things, followed by errors that are caused by running out of space.

Could you install to /tmp, compile the binaries, then copy the binaries back to the project for use after the project restarts? (I haven’t tried this myself)

Hey @simonw would you be willing to share a project name? When I spin up a new static site project and then use pip3 install datasette --user it takes up about 23Mb as far as I can tell. However it is possible something changed here that I’d like to investigate.

I think the problem is also attempting to install csvs-to-sqlite since that depends on Pandas. Try remixing this project: https://glitch.com/~datasette-csvs

I think I can drop the Pandas dependency - I will try that this afternoon.

OK, I got it working! https://glitch.com/edit/#!/datasette-csvs is now using my sqlite-utils CLI tool (instead of csvs-to-sqlite) which has much lighter dependencies and doesn’t use up all available disk space.

For the record, here’s the old broken version which no longer works: https://glitch.com/~datasette-csvs-previous