Forums

Python 3.6 support

Is 3.6 coming any time soon? I'm eager to use f-strings.

It's coming, but no timeline yet -- because it's hard for us to upgrade point releases (eg. 3.4.3 to 3.4.4), we're waiting a bit just to make sure that 3.6.0 isn't going to be replaced quickly with a security patch 3.6.1 release.

Any update on the timing to support python 3.6

It's in progress. 3-6 weeks maybe?

Looking forward to it.

One of the exiting things in 3.6 is variable type annotations in code (rather than clumsily in comments like before) So this would be valid syntax:

items: List[Item] = get_items()

Then your autocompleter works.

Hello,

AFAICT you can use any python version you like - independently of it being pre installed - by compiling it yourself or letting pyenv (use this to install pyenv: https://github.com/pyenv/pyenv-installer ) do the heavy lifting. I just tried it on my account:

14:32 ~ $ pyenv install 3.6.1
Downloading Python-3.6.1.tar.xz...
-> https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
Installing Python-3.6.1...
Installed Python-3.6.1 to /home/obestwalter/.pyenv/versions/3.6.1
14:43 ~ $ mkdir adfd
14:50 ~ $ cd adfd
14:50 ~/adfd $ pyenv virtualenv 3.6.1 adfd
Requirement already satisfied: setuptools in /home/obestwalter/.pyenv/versions/3.6.1/envs/adfd/lib/python3.6/site-packages
Requirement already satisfied: pip in /home/obestwalter/.pyenv/versions/3.6.1/envs/adfd/lib/python3.6/site-packages
14:50 ~/adfd $ pyenv local adfd
(adfd) 14:51 ~/adfd $ python
Python 3.6.1 (default, May 11 2017, 14:38:10) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

... or is there anything speaking against this approach?

The python versions and virtualenvs are in $HOME/.pyenv/versions by default and can be choosen to run your web app.

Doing this burns up a few CPU seconds, but even with the hacker account it is not a problem to do this and still have enough CPU seconds left (I did this just now and this is my current status: CPU Usage 15% used: 310.55s of 2,000s)

Cheers, Oliver

... oh - I see. If you want to create your web app you have an option field to choose the Python version which does only got up to 3.5 and choosing the created Python virtualenv warns that the folder is not a virtualenv although it is. Pitty.

and I completely missed this anyway: http://blog.pythonanywhere.com/151/#disqus_thread - so just ask for the dangermouse image via feedback link and you're in :)

Yup, that's all you need to do! We released Python 3.6 for the dangermouse image back in March, not long after the post in this thread prior to your first one.

I see you send us a feedback message asking for your account to be upgraded, so I've replied to that over email.

Thanks giles,

I got the update. It is running a 3.6.0 - when you go live with the next image, will you use the latest patch release? 3.6.1 is released already and chances are good 3.6.2 is out when you release the dangermouse image. Would be interesting to learn how you go about this. I guess I will have to start following your blog more closely.

Cheers, Oliver

The problem is that upgrading point releases of python (currently) breaks everyone's virtualenvs, so if we want to upgrade point releases, we have to do a whole new system image build. But we do plan to do one soon. Planned codename: "earl grey". No eta yet tho.

Hello, still waiting for Python 3.6. When will be ready?

It's been available since March, but to enable it for your account, we need to switch you over to the new system image. This will mean that all of the pre-installed Python modules will be upgraded to newer versions, so it might break any existing code you have that depends on older versions. But if you're happy for us to go ahead, just let us know.

Any ETA on "earl gray" point release?

Unfortunately no concrete ETA yet! Sorry!

Giles, I'd like for mine to be moved to 3.6. I just started working on something and nothing is working for me.

@mynameiskaleb -- your account is already fully set up to have Python 3.6. What problems are you seeing?

I worked it out. I was used to using an alias to set python to python3. But I found what I was looking for. Thanks for the reply.

@giles - Does that mean that Python 3.6 support is now available for anyone?

I think your set it via web tab.

"Not I", said the fox.

At least the fox would say that if they used PythonAnywhere.

https://imgur.com/a/MPSls

My fault. I'm not looking at mine right now. I'm afk so I assumed it was 3.6. Sorry.

@HLX0 -- it's available in our "dangermouse" system image; you're on the previous image, "classic". We can certainly switch you over -- but there are potential problems, as dangermouse has different versions of the globally-installed Python packages, so any code you have that depends on the old versions might stop working.

You can see the different versions of packages in different system images here. If you'd like us to switch your account over, just let us know.

@giles I would be glad to use the dangermouse image if possible, thank you for your support :-)

Ok. I have switched your account to the dangermouse image.

Can my account be switched to the dangermouse image?

Thanks

Just to clarify, since the previous posts in 2018, we now have a newer image (earl grey). Would you like to switch to that instead? Or dangermouse? And to confirm, your code may break because libraries may be updated, and you will have to rebuild your virtualenvs again.

Yes please switch me to the new image. I'll update my code.

Okay, we have switched you over to the new earlgrey image. Please note that any old consoles will still be running on the old image, but any new consoles that you start will be on the new image! Also, you will need to restart any webapps for the changes to take effect.