Pycharm cannot import math module

21,609

Solution 1

Check that you are pointing to the correct python file within Settings > Project > Project Interpreter.

When I've had this problem in the past my interpreter was pointing at python3.6 and not python within the bin folder of my venv. I simply dropped the interpreter and added it again pointing to the venv-name/bin/python

Solution 2

File >> Settings >> Project interpreter. You should see a list of currently installed packages/libraries. If the module is not specified in there click the plus sign and look for your module in there. Also make sure you specify it correctly when you import it.

Share:
21,609

Related videos on Youtube

Michael
Author by

Michael

Updated on July 09, 2022

Comments

  • Michael
    Michael almost 2 years

    I can't import standard math module in pycharm, I'm getting an error: "No module named math", from python shell I can import it, what can cause that?

    • DavidG
      DavidG over 6 years
      You are going to have to provide more information on the code you use and how you have setup PyCharm
    • jciloa
      jciloa over 6 years
      Updating PyCharm solved it for me!
  • Michael
    Michael over 6 years
    I don't see math here, and I cannot install it from here.
  • Maximouse
    Maximouse almost 4 years
    Please note the question says "I can't import the standard math module".