KansaiRobot
KansaiRobot

Reputation: 9912

After installing pandas it only gets recognized by python not python3

My system has python 2.7 in usr/bin/python and python 3 in usr/bin/python3.

I need to use pandas and it seems it was not installed. (I got the No module named pandas)

so I did pip install pandas and it got installed.

My problem is that if I type python I can import pandas without problem but if I type python3 and I am in the python 3 environment, I cannot import pandas and I get a "No module named pandas"

How can I install pandas to be found by python3?

Upvotes: 1

Views: 54

Answers (2)

Adrian Klaver
Adrian Klaver

Reputation: 19665

Try:

pip -V
pip3 -V

I'm go to believe the first returns something like:

pip 19.3.1 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

The second should return something like:

pip 20.1 from /usr/lib/python3.6/site-packages/pip (python 3.6)

If the second returns something then:

pip3 install pandas

Otherwise you will need to use the package manager to install it.

Upvotes: 1

d_kennetz
d_kennetz

Reputation: 5359

which pip will probably tell you that pip by itself is the python2 installer. To explicitly install into python3 do

pip3 install pandas

Upvotes: 2

Related Questions