0

I'm trying to learn how to use matplotlib to start replacing Matlab in my life, but I'm having trouble getting started. I added python and pip to my path so i could pip install matplotlib from my command prompt, and I see it's installed in my python\lib\site-packages file, but when I type in "import matplotlib.pyplot as plt" to get started and run the rest of my simple plot code, pycharm says that there is no module named matplotlib. My plot code runs fine on the shell, copied and pasted from the same stuff I'm trying to run in pycharm however. What do I need to do to go this to run in pycharm as well?

1
  • 1
    use pip3 install matplotlib to install matlplot lib. By default, pip will install those package for 2.7 as it the native one. For python 3 you'll have to install it. Commented Oct 20, 2018 at 1:47

2 Answers 2

1

Pycharm can select between many different python installations on your system, it sounds like you have selected a version different from the one in which you installed matplotlib. You probably installed matplotlib with pip. Check which pip you used by putting which pip if you're under *nix. then check which one Pycharm is using in your project.

Sign up to request clarification or add additional context in comments.

Comments

0

Is your pycharm path the same as your terminal path?

import sys
sys.path

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.