Forums

latest python in virtualenv

I created a new 2.7 virtualenv today, it worked fine except it's python version 2.7.6 while I have been developing on 2.7.12. I tried virtualenv -p /usr/bin/python2.7.12 myvename but got "the executable does not exist"

Is it possible to upgrade? Or to create a new venv on 2.7.12? Thanks.

(also, I got a SNIMissingWarning and InsecurePlatformWarning when using pip, although it successfully downloaded and installed everything in my requirements.txt)

Virtualenvs do not contain a different version of Python, they use the one installed already. We do not, at the moment, have any way for you to change the version of Python because that would break everyone's virtualenvs. We are working on a feature that would allow it in future and we hope to have that available soon.

You can fix the warnings by doing:

pip install urllib3[secure]

in you virtualenv

Hi Glenn,

I am attempting to resolve the SNIMissingWarning and InsecurePlatformWarning thrown by urllib3 under Python 2.7.6 installed on PythonAnywhere. I would also really, really like to run 2.7.12 if possible.

I followed your instruction above but installing the secure option on urllib3 didn't resolve the warnings for me.

It seems like anyone doing outgoing connections from their PA app under Python 2.7 would experience this same issue.

Just to be clear, this is the issue I'm referring to - https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings.

Thank you,

Taylor

Hi Taylor,

This used to be solved by installing urllib3[secure]. However, the newest version of pip (<1 month ago) broke this. See here. We are monitoring/waiting to see if this will get fixed soon before deciding what to do about it.

Conrad — Thank you, I'll subscribe to that! I hadn't seen this yet. In the meantime, is it possible for me to selectively ignore them? I've never tried to drop my log level for just one package, but it's really blowing up my Opbeat account / email / push notifications. Over 100 instances of the same error since I posted.

I think there is a way of suppressing those warnings selectively... Check this link?

Great find, Harry. I'll give that a shot.

Hi, I'm facing this same problem. Having installed urllib3[secure] inside a virtualenv I still can't access an external website. Does it mean that on Python 2.7 installed across PythonAnywhere it's impossible to overcome this?

Thanks a lot in advance for support. Karol

This actually worked for me: https://www.pythonanywhere.com/forums/topic/2739/#id_post_37300

This actually worked for me: https://www.pythonanywhere.com/forums/topic/2739/#id_post_37300

thanks for letting us know!

Any news about the Python 2.7 version? I can see we are still in 2.7.6 and latest is 2.7.15. Any way for upgrading it? I solved those InsecurePlatformWarning messages but now I got

CryptographyDeprecationWarning: Support for your Python ve rsion is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.

Thanks!

We should be adding a new system image on our deploy next week. This will bump up the python2.7 version. Email us after the deploy to switch to the new image!

Are there any news about upgrading python2.7 to its latest version? This thread seems to be dead for a while and I wonder whether it's possible to use latest python 2.7 in pythonanywhere...

Our latest system image supports Python 2.7.12 -- it looks like you're on an older one, which is why you still see 2.7.6. We can easily switch you over to the new system image, but one word of warning first -- because changing the system image upgrades a lot of the pre-installed Python packages, any code that you have that relies on those packages might break if it's not compatible with the new versions. Also, because the new image has newer versions of Python, if you have any virtualenvs, you may need to rebuild them -- for example, a 2.7.7 virtualenv might not work properly with 2.7.12. If you're happy to go ahead despite that, just let us know and we'll switch you over.

Can we schedule the change? For example, it would be good for me to do it on Friday sometime around or after 20:00:00GMT

We can schedule it any time up to about 19:00 UTC on Friday -- however, it's worth noting that our tech support team will only be handling global system outages after that, so we won't be able to roll the change back until sometime on Saturday if you want us to do that.