-1

I am using Pycharm Community 2022.2 with Python 3.8.10. I can check that python console has the correct interpreter with all the packages correctly installed. I can run my scripts from the terminal in Pycharm with no problems. However when I try to run my script using the python console, I get error in the first line (import pandas) that it doesnt recognize pandas. I tried to import other packages (that already installed) from python console but they don't get recognized "name 'numpy' is not defined"

Can you please help

McCruise
  • 29
  • 5
  • [\[SO\]: PyCharm doesn't recognize installed module (@CristiFati's answer)](https://stackoverflow.com/a/73363599/4788546). – CristiFati Oct 16 '22 at 12:31
  • @CristiFati in this case it's actually different from the solutions you're offering in your answer. What most beginners will be looking for is setting their venv as the default environment of the console via GUI in the settings. – bad_coder Oct 16 '22 at 13:25
  • See [this screenshot](https://www.jetbrains.com/help/pycharm/interactive-console.html#python-console-settings) from the docs. – bad_coder Oct 16 '22 at 13:26
  • @McCruise: Isn't that info contained in one of the *URL*s from the answer (or in other answers)? – CristiFati Oct 16 '22 at 14:53
  • Thanks, it's working now. I had to check the interpreter paths, and add the correct path for the packages. – McCruise Oct 16 '22 at 22:30

1 Answers1

0

i faced the similar error once. in that case i used cmd to check whether my python is installed by the command "where python" . once i finded out that my real python is installed under a different location i simply changed the location of interpreter in pycharm and it worked. Try this if this is your scenario.. Otherwise i am sorry.

lupin2255
  • 11
  • 2