Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install Pandas (python package) on Ubuntu. I can't find it in the repos. Is there a package repo for this or do I have to install from source?

share|improve this question

migrated from stackoverflow.com Oct 23 '11 at 2:13

This question came from our site for professional and enthusiast programmers.

    
Ensure you're getting the most up to date version of pandas (the one in the repo is 0.7 whilst the latest stable is 0.13.1). – hayd Feb 27 '14 at 2:08

I'm taking python class, professor suggests us to install in this way, pip is much better than setuptools and easy_install

sudo apt-get install python-pip
sudo pip install numpy
sudo pip install pandas
share|improve this answer
    
This is definitely better. – hayd Feb 27 '14 at 2:10
    
Do note that numpy docs state that a pip installed numpy might be slower than one that was apt-get installed. – don.joey Nov 10 '15 at 15:44
    
This method can install the latest pandas version (0.18.0) in ubuntu 14.04.4 – zhihong Apr 12 at 12:54

The solution with easy_install didn't install properly on a Ubuntu 12.04 system, while

sudo apt-get install python-pandas

did a proper install.

share|improve this answer
2  
Worth mentioning that this will install the much older version 0.7 of pandas was bundled in 12.04 (the current version is 0.13.1). – hayd Feb 27 '14 at 2:07
    
I just did this on ubuntu 14.04, but when I run # python -c 'import pandas;' I get Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named pandas – shadi May 13 at 7:34
    
It turns out that apt-get install installs pandas into /usr/lib/python2.7/dist-packages/pandas which was not on my python path. To check the python path I used python -c 'import sys; print sys.path;'. The working import is python -c 'import sys; sys.path.append("/usr/lib/python2.7/dist-packages"); import pandas as pd;' – shadi May 13 at 7:41

It's in the Python package index - use easy_install or pip.

sudo aptitude install python-setuptools # installs easy_install for your python version
sudo easy_install pandas

Replace aptitude with apt-get if your version doesn't have aptitude installed, or use synaptic or whatever package manager your version has installed by default.

share|improve this answer

An alternative method to install pandas, which can be done without sudo, is to use Anaconda:

  • Download the linux build continuum website: http://continuum.io/downloads
  • Run the file and follow the installation instructions:

    bash Anaconda-1.9.1-Linux-x86_64.sh  # file may have different version numbers
    

This will install python and pandas (and lots of other modules) in an anaconda directory in home (by default).

You can update to the latest version of pandas (along with other modules) using conda:

conda update pandas

You can also create virtual environments and other useful things...

The problem this solves, over pip, is that there are issues in software dependencies of some modules (scipy especially is tricky) or versions compiled against an incorrect version of numpy.

It's useful to be on the latest version for bug-fixes and performance enhancements! A lot has changed since version 0.7 (which is the version packaged in 12.04).

share|improve this answer

To install through > bash Anaconda.. you need to have bzip2 installed

sudo apt-get install bzip2

then follow Hayd's suggested procedure

Also make sure to install it on your home dir (without root) and to source .bashrc so you do not have to open a new session as requested

source ~/.bashrc

then proceed with

conda update pandas

Hope that helps!

share|improve this answer
sudo pip3 install pandas

This will install the latest version of pandas for Python 3 whereas apt-get does not.

share|improve this answer
1  
sudo and --user? O.o – muru Mar 10 at 11:46
    
Corrected that. – user3650331 Mar 10 at 15:08

protected by Community Mar 10 at 15:36

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.