Prudhvi Charan
Prudhvi Charan

Reputation: 115

Can a python module be imported without installing

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

Upvotes: 0

Views: 72

Answers (1)

Carlos Cordoba
Carlos Cordoba

Reputation: 34136

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).

Upvotes: 1

Related Questions