1

I'm learning a little bit how function python, more specific Flask.

I'm creating a new project using flask, but when I create a new file and import Flask I receive this error: No name 'Flask' in module 'flask'pylint(no-name-in-module)

I did read that, I need create a file called: __init__.py but I have this and the error keeps showing up.

This is my actual code (very simple code, and folder/files structure): enter image description here

Thanks for the help! :D

I tried this: Flask ImportError: No Module Named Flask, but this solution does not works for me.

enter image description here

enter image description here

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
Reco Jhonatan
  • 1,503
  • 4
  • 23
  • 35

2 Answers2

0

I installed flask on python 2.7 and run simple hello world script and it worked fine. Then I updated python to python 3.8 and I got an error similar to yours:

Unable to import 'flask'pylint(import-error)

I simply uninstalled flask and installed again and it worked for me. Run this two commands:

pip uninstall flask
pip install flask

Then export the FLASK_APP environment variable and run flask

set FLASK_APP=file.py
flask run
toh19
  • 1,083
  • 10
  • 21
0

I solved this changing my python interpreter. I did uninstall pylint and install pylama and now all is fine!

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
Reco Jhonatan
  • 1,503
  • 4
  • 23
  • 35