Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'Flask' #129

Closed
alex-manutd opened this issue Oct 5, 2018 · 14 comments
Closed

ImportError: cannot import name 'Flask' #129

alex-manutd opened this issue Oct 5, 2018 · 14 comments

Comments

@alex-manutd
Copy link

Hi Everyone,

Python N00b. I have searched issues but couldn't find a solution to the same problem as mine.

I am at STEP 3: and am getting the following error when I run python3.6 blockchain.py:

(It could be relevant that I haven't installed Postman yet.)

Traceback (most recent call last):
File "blockchain.py", line 7, in
from flask import Flask, jsonify, request
ImportError: cannot import name 'Flask'
alex@alex-XPS-13:~/Projects/python/blockchain$

Thanks for your help kindly.

@smouli
Copy link

smouli commented Oct 8, 2018

pip install Flask
pip install jsonify
pip install request

If you do not have pip installed,
https://pip.pypa.io/en/stable/installing/
This link should help

@chiukapoor
Copy link

Open command prompt or terminal and type

pip3 install Flask
pip3 install jsonify
pip3 install request

@dvf
Copy link
Owner

dvf commented Oct 23, 2018

Just do pip install -U pipenv && pipenv install && pipenv shell

@dvf dvf closed this as completed Oct 23, 2018
@alex-manutd
Copy link
Author

alex-manutd commented Nov 6, 2018

IT WORKS!

pip3 install Flask
pip3 install jsonify
pip3 install request

followed by:

pip3 install Flask==0.12.2 requests==2.18.4

python3 blockchain.py

Thank you all!!

@Victorvick399
Copy link

It did not work and error message is
Traceback (most recent call last):
File "manage.py", line 1, in
from app import create_app,db
File "/home/victor/Documents/Pitches/app/init.py", line 1, in
from flask import Flask
ImportError: cannot import name 'Flask'

@Harishyadav766
Copy link

for me also it coming same error even though i installed all dependencies. can any one help me out with this

Traceback (most recent call last):
File "flask.py", line 1, in
from flask import Flask
File "/home/harishwojtyla/Desktop/flask-jwt/tests/flask.py", line 1, in
from flask import Flask
ImportError: cannot import name 'Flask'

@CaydendW
Copy link

Have you named your project flask.py or Flask.py? If you have, change it. It is trying to import itself and is failing causing an import error.

@Abderrahmane-Boujendar
Copy link

Abderrahmane-Boujendar commented Sep 28, 2020

@CaydendW you are a life saver thanks bro

@CaydendW
Copy link

Glad I could help @Abderrahmane-Boujendar

@TalMoshel1
Copy link

hey guys, did all the solutions you have written,
still got the problem: cannot import name 'Flask' from 'flask'
any more help?

@CaydendW
Copy link

CaydendW commented Sep 3, 2021

What's the file name for your project?

@TalMoshel1
Copy link

TalMoshel1 commented Sep 4, 2021

its "API endpoints.py"
thank you

@afjal6000
Copy link

i changed the name but still not working
ImportError: cannot import name 'Flask' from partially initialized module 'webf' (most likely due to a circular import)

@dhanushdevan
Copy link

This error happen to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

12 participants