Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are my imports no longer working?

I refactored my webapp and now my IDE pycharm marks some imports red. Why?

from wtforms import Form, TextField, validators, SelectField

My IDE marks the Form, TextField and the SelectField red as they cannot be imported. ("Unresolved reference"). What should I do if I need those classes in my project?

like image 568
Montao Avatar asked May 03 '15 05:05

Montao


2 Answers

Try deleting the libraries from your project if they are in libraries, then re-importing those libraries.

Also, I assume you've done this, but make sure the libraries are actually installed and present in a reachable location that is properly mapped.

like image 112
King Dedede Avatar answered Oct 03 '22 04:10

King Dedede


You need to install it in in your environment(according to the comments you didn't), please try the following:

Settings -> Project: MyProjectName -> Project Interpreter

Then click on the green plus and choose your packages

like image 43
Or Duan Avatar answered Oct 03 '22 02:10

Or Duan