Nam G VU
Nam G VU

Reputation: 35374

Pycharm interpreter error for Flaskr application (official Flask tutorial sample)

My context

The issue

My question

How can I fix it?

enter image description here

enter image description here

Upvotes: 0

Views: 340

Answers (1)

Doobeh
Doobeh

Reputation: 9440

It's looking for a functional Python installation.

If you open the 2 drop-down you've referenced you'll see a selection of Python installations on your machine.

The better option though, is to create a virtualenv for your current project, so click on the cog icon to the right of the Project Interpreter drop-down and click Create VirtualEnv and follow the prompts.

Once created, it should pick that VirtualEnv as the default Python interpreter for that project and your error will disappear, though remember, because it's a new virtualenv, it won't yet have Flask etc installed on it. You can install the Flask library by clicking the + icon underneath the cog and searching/installing for Flask.

Alternatively, create a requirements.txt file on your project root directory, with Flask as the contents, and PyCharm will notice that next time you are in a .py file and suggest to automatically install Flask.

Upvotes: 2

Related Questions