9

I'll preface by saying I'm a programming n00b by stack standards. I have experience with data analysis and scripting -- this is what I do professionally at a financial firm -- but I have no idea what I'm doing on the back end.

I'm trying to start using pandas and python --- moving away from matlab/vba but I can't figure out how to install the pandas library.

When I try to import pandas I get an error that numpy module is not present. I tried to install ezsetup / pip (no idea what this is btw)... and I have no idea where to enter this command$ python get-pip.py

Sometimes when I try to import pandas I get an error cannot import name table hashable

I have no idea what any of this means and I am not getting anywhere.

Update

Ok I installed anaconda and it seems to be allowing me to import numpy and pandas directly from the console. That being said when I try to write a basic time series and plot it using pandas syntax, i get an error that "series is not defined" as such I'm not sure if it is actually working

  In [1]: import matplotlib.pyplot as plt
  In [2]: ts = Series(randn(1000), index=date_range('1/1/2000', periods=1000))
  In [3]: ts = ts.cumsum()
  In [4]: ts.plot()
2

6 Answers 6

11

NOTE: This answer is no longer up to date. The Python Extension Packages for Windows site has been archived and is no longer being updated as of June 2022. Use pip for installing Python packages.

The best resource for third-party modules for Windows is Christoph Gohlke's Python Extension Packages for Windows repository. Each module is available as a self-extracting .exe installer, for use with the python.org version of Python - make sure you get the correct installer for your version and architecture.

While NumPy does not require any other packages, pandas does, so make sure you get them all. The installation order is not important.

The advantages of this resource over a distribution like Anaconda or Enthought is that Dr. Gohlke keeps the packages very up to date, allowing you to run the latest versions of the modules. Additionally, nearly all of the modules have multiple Python versions, while some of the other distributions are only based on Python 2.7.

The disadvantage is that you need to install each package individually, and there is no package manager for handling dependencies.

2
  • 1
    At least Anaconda is also very up to date, and supports python 2.6, 2.7, 3.3, and 3.4. I would really recommend using a python distribution like this over installing all packages manually (dartdog's answer).
    – joris
    Jan 6, 2015 at 21:43
  • 1
    @joris I wrote this answer over a year ago, and my experience with Anaconda then was not particularly positive as far as being up-to-date with the latest versions of modules, or even the latest release of Python. If that's changed, then great!
    – MattDMo
    Jan 6, 2015 at 21:48
7

Best to use a pre-packaged solution, Anaconda or Enthought particularly with windows

3
  • 1
    100% this answer (esp. Anaconda) if on Windows, installing and maintaining the packages separately is a nightmare otherwise
    – YXD
    Dec 17, 2013 at 18:06
  • Yes particularly for newbies,, It just works and has everything one might need, no hunting around for the packages.. One click install IPython notebook Pandas Scipy numpy , the works..
    – dartdog
    Dec 17, 2013 at 18:13
  • 1
    Anaconda has a few issues on windows just a warning.
    – ehsteve
    Jan 22, 2014 at 19:23
6

Try this: It should work.

Go to the location where you have Python (C:\Python34) Run the blow command:

python -m pip install pandas

NUMPY installed automatically after my Pandas installation.

3

I had the same headaches and the solution I finally found was to install python xy. This seems to include every package I have ever dreamed of using, and weeks of frustration evaporated almost instantly (related to pandas and many others. It's a great collection of everything you will need. It includes most all of the libraries mentioned above)

While YMMV, Enthought's Canopy caused issue after issue after issue for my installation. I advise to steer clear.

1
  • It's a great way to get everything in one package, but using 2.7 is a big shortcoming. Jun 14, 2016 at 20:23
2

First upgrade pip version using command python -m pip install --upgrade pip after that just do pip install pandas

Note : - For pandas python-dateutil, numpy, setuptools and pytz module required.

0

To install pandas for Python 3, you may need to use the python-pandas package. While NumPy does not require any other packages, pandas does, so make sure you get them all. The installation order is not important. ... The disadvantage is that you need to install each package individually, and there is no package manager for handling dependencies.

To Install numpy pip install numpy

To install pandas pip install pandas

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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