0

I just started learning about Python (on macOS Mojave). I downloaded the latest version of Python and wanted to download software libraries like pandas.

So firstly I downloaded pip like that: sudo easy_install pip

Then I installed pandas using pip, however pandas location is: Requirement already satisfied: pandas in ./Library/Python/2.7/lib/python/site-packages (0.24.2)

However, my Pythons location is: Location of Python 3.8.2: '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3'

Also when I try importing pandas in the python command I get this: ModuleNotFoundError: No module named 'pandas'

Therefore, it seems that pip has installed pandas to the old version of Python. How can I fix that? Or is that even the problem? Again I am totally new to this and I don't come from a cs background. Please help.

  • Does this answer your question? [Dealing with multiple Python versions and PIP?](https://stackoverflow.com/questions/2812520/dealing-with-multiple-python-versions-and-pip) – AMC May 03 '20 at 00:30
  • Use virtual environments, or something similar. – AMC May 03 '20 at 00:30

2 Answers2

2

You might have both pip and pip3 installed, where the first is used for python 2.7 and the second for python 3.8.2

pip3 install pandas
jcaliz
  • 3,891
  • 2
  • 9
  • 13
  • https://stackoverflow.com/questions/2812520/dealing-with-multiple-python-versions-and-pip – AMC May 03 '20 at 00:30
0

You need to add pip to your terminal's commands. In the meantime, you could do this:

python -m pip install pandas

Note that that will only work if when you run python -V, you get python 3.8.2.

xilpex
  • 3,097
  • 2
  • 14
  • 45
  • https://stackoverflow.com/questions/2812520/dealing-with-multiple-python-versions-and-pip – AMC May 03 '20 at 00:30