Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas and Python3.4 co existing with Python 2.7

I have pandas installed with python2.7. I also have python 3.4 installed.

I can't load pandas in python3

Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pandas'
>>> 

I understand I need to install it separately. How do I go about having pandas in both python 2.7 and 3.4 ? I am using a mac by the way.

like image 342
Vinay Joseph Avatar asked Aug 07 '14 01:08

Vinay Joseph


People also ask

What version of Python is pandas compatible with?

Python version support Officially Python 3.8, 3.9 and 3.10.

Is Python 2.7 still used?

Although Python 2 is almost outdated, it is still used today by some software professionals due to some of its special features.

Does Python 3.7 support pandas?

Before you install Pandas, you must bear in mind that it supports only Python versions 3.7, 3.8, and 3.9. Therefore, if you have not installed Python on your computer or have an older version of Python installed, you must install a version that supports Pandas on your computer.

Can you mix Python 2 and 3?

Don't "mix". When the various packages and modules are available in Python 3, use the 2to3 conversion to create Python 3. You'll find some small problems. Fix your Python 2 so that your package works in Python 2 and also works after the conversion.


2 Answers

Figured it out.

python3 -m pip install pandas
like image 109
Vinay Joseph Avatar answered Oct 03 '22 15:10

Vinay Joseph


You might find that you have a script called "pip3" on you system as python3.4 bundles pip in along side of python.

$ pip3 install pandas
like image 43
dannyla Avatar answered Oct 03 '22 15:10

dannyla