Forums

Need to upgrade from python 2.7 to 3.6

Hi Team,

Could you please do this ASAP for me. I tried pip install --upgrade python 3.6 on the bash and it always points to 2.7 with the following message .

Requirement already up-to-date: python in /usr/lib/python2.7/lib-dynload Collecting 3.6 Could not find a version that satisfies the requirement 3.6 (from versions: ) No matching distribution found for 3.6 "

Thanks Surya

You need to update your system image. See https://help.pythonanywhere.com/pages/ChangingSystemImage

Hi, thanks for the info.

But after I have updated the image to 3.7, a new error is seen on the logs

ImportError: No module named flask_mail
2021-08-23 11:44:57,878:   File "/var/www/academy_merusikhara_com_wsgi.py", line 16, in <module>
2021-08-23 11:44:57,878:     from app_rest_api_enterprise_qa import app as application  # noqa
2021-08-23 11:44:57,878: 
2021-08-23 11:44:57,878:   File "/home/SuryaIOT/enterprise/app_rest_api_enterprise_qa.py", line 12, in <module>
2021-08-23 11:44:57,878:     from flask_mail import Mail, Message

and when I try to install flask-mail - it fails with below error

class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'
11:45 ~ $

after I do unset PYTHONPATH the above error is gone... but i still see the same ImportError: No module named flask_mail on the logs

Could you please check

Thanks, Surya

11:45 ~ $ pip install Flask-Mail
Traceback (most recent call last):
  File "/home/SuryaIOT/.local/bin/pip", line 3, in <module>
    import re
  File "/usr/local/lib/python3.7/re.py", line 145, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
11:45 ~ $

There are multiple Python versions installed. You probably need to specify pip for the Python version you're using. See: this help page.

Hi I used specific -.7 pip install --user and I get below error! class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' 04:54 ~ $

04:54 ~ $ pip3.7 install --user Flask-Mail                            
Traceback (most recent call last):   File "/usr/local/bin/pip3.7",
line 3, in <module> import re   File "/usr/local/lib/python3.7/re.py", line 145, in <module> class
RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'
04:54 ~ $

I need to resolve this asap. How do I get online-support or tele-support to resolve this immediately? Could you please help.

Did you install enum34 package by any chance? See: https://stackoverflow.com/a/45716067/9536161. I just tried to install Flask-Mail on a fresh account and it went flawlessly.