Reputation: 2797
I am using vscode for coding my python code. I use pandas, numpy and requests library in my code. If I run the code, It works fine. But in VScode editor, in the problems section, always Its says the message as
Unable to import 'numpy' (pylint import error)
Unable to import 'pandas' (pylint import error)
Unable to import 'requests' (pylint import error)
I searched in StackOverflow questions to find the answer to this problem, It says to install pandas
using pip
. I did that also. But still I am facing the same problem. How to fix this problem in vs code editor
Upvotes: 13
Views: 17588
Reputation: 16942
This is not telling you that numpy
or pandas
is not installed. It is telling you that pylint
can't verify your numpy
and pandas
calls. Most of numpy
and pandas
is written in C, not Python.
The pylint
documentation says
Linting C extension modules is not supported out of the box, especially since pylint has no way to get an AST object out of the extension module.
So there is no problem with your code, even if VSCode says it is a problem. It is a technical limitation of pylint
. If it worries you, disable pylint
message E401 for these import
statements. Put #pylint: disable=E401
on the same line as your import
statement.
Upvotes: 15