There can be few reasons for this:
REASON 1: USING A VIRTUAL ENVIRONMENT
It can be possible that you are using a virtual environment for your project. If you will try to intall an module from pip in cmd then it will installed to your system interpreter and not your virtual interpreter.
SOLUTION:
to solve this open the directory where your virtual environment lies and shift+right click on windows explorer there you will a option to open power shell here. Click it. And now you can enter the same command to install you desired module.
REASON 2:IMPORTING FROM ANOTHER INTERPRETER
It can also be possible that you are not using a virtual env. But still getting the error it can be because you are intalling the module in some interpreter and importing it from another interpreter.
SOLUTION:
to solve this first check that on which interpreter you are installing the module to by entering "python version" command in cmd and match it with the interpreter from which you are trying to import the module. If the interpreters are different the configure the respective interpreter.
There can also be other issues with the interpreter. So just experiment around and it will improve your overall technical knowledge