I'm trying to install flask on for python3 in Centos7. It seems to be installed correctly, but it doesn't import right. There aren't any files called flask in the same folder, so it's not a problem with importing something else.
Notice that it works in python 2.7
$ python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
>>> flask.Flask
<class 'flask.app.Flask'>
>>> from flask import Flask
>>> exit()
But gives an error in python 3.6
$ python3.6
Python 3.6.4 (default, Dec 19 2017, 14:48:12)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
>>> from flask import Flask
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Flask'
Has anyone run into this problem before?
I used sudo yum install flask
to install it on centos7 and I used pip3 to install flask pip3 install flask
$ sudo pip3 install flask
Requirement already satisfied: flask in /usr/lib64/python3.6/site-packages
Requirement already satisfied: itsdangerous>=0.21 in /usr/lib/python3.6/site-packages (from flask)
Requirement already satisfied: click>=2.0 in /usr/lib/python3.6/site-packages (from flask)
Requirement already satisfied: Jinja2>=2.4 in /usr/lib/python3.6/site-packages (from flask)
Requirement already satisfied: Werkzeug>=0.7 in /usr/lib/python3.6/site-packages (from flask)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.6/site-packages (from Jinja2>=2.4->flask)