googlekid
googlekid

Reputation: 155

how to install numpy and pandas on windows

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()

Upvotes: 9

Views: 84665

Answers (6)

MattDMo
MattDMo

Reputation: 102892

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.

Upvotes: 11

Tono Kuriakose
Tono Kuriakose

Reputation: 886

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

Upvotes: 0

sandeep rathore
sandeep rathore

Reputation: 82

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.

Upvotes: 2

AskMe
AskMe

Reputation: 2581

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.

Upvotes: 6

Brian Leach
Brian Leach

Reputation: 4154

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.

Upvotes: 3

dartdog
dartdog

Reputation: 10872

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

Upvotes: 7

Related Questions