Markas Povilaika
Markas Povilaika

Reputation: 67

Pip installs files to the old version of Python (Pip, Pandas, Python, Mac)

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.

Upvotes: 0

Views: 763

Answers (2)

jcaliz
jcaliz

Reputation: 4021

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

Upvotes: 2

xilpex
xilpex

Reputation: 3237

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.

Upvotes: 0

Related Questions