Is this possible that a module is imported without installing the same. If no then why is my spyder IDE is showing a warning on the line where it is written import nltk even when nltk is not installed
Asked
Active
Viewed 71 times
0
-
1If I read your question correctly, it seems like you are asking why is spyder showing a warning statement at "import nltk" even when nltk is not installed. Isn't that expected behavior? Am I missing something? – Vince W. Mar 13 '17 at 18:36
-
What happens when you run `import nltk`? – smttsp Mar 13 '17 at 18:37
-
I am sorry . I missed the important problem. It shows a warning that states 'nltk imported but unused'. – Prudhvi Charan Mar 13 '17 at 18:46
-
how does it say nltk imported way before installing it – Prudhvi Charan Mar 13 '17 at 18:47
1 Answers
1
Spyder runs a static analysis on the code you have in the Editor to offer hints and errors about it.
Since the analysis is static, it means Spyder doesn't run your code to perform it. In your case it simply detects that you have a line like
import nltk
but that there's no other use or call to nltk
(for example, with a code like nltk.pos_tag(tokens)
or something like that).

Carlos Cordoba
- 33,273
- 10
- 95
- 124