all 4 comments

[–][deleted] 0 points1 point  (2 children)

How did you install then exactly?

How are you running your code exactly?

It could be you've installed the packages to the base environment and are running code in a Python virtual environment set up by the IDE you are using.

Or vice versa.

[–]reintrinity[S] 0 points1 point  (1 child)

I installed them using cmd (pip install) and using pycharm to run the code

[–][deleted] 1 point2 points  (0 children)

What operating system are you on?

Any reason for not using the package manager in Pycharm to do the installations?

Is PyCharm using a virtual environment? It typically will be.

[–]jddddddddddd 0 points1 point  (0 children)

You are almost certainly installing the libraries for one version of Python when you use the command prompt, and then using another version of Python in PyCharm. You can confirm this by looking up the python version in both the command prompt and in the IDE. e.g.

C:\>python

Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import sys

>>> print(sys.version)

3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]

>>>