7

I am trying to install pandas via pip install pandas but when I do, I get the error:

Command python setup.py egg_info failed with error code 1 in c:\users[username]\appdata\local\temp\pip_build_[username]\pandas

I followed the answer given here and installed ez_setup.py without incident, but still get the error when doing pip install pandas.

Thanks for any help, if I can provide more information please let me know.

Bonifacio2
  • 3,405
  • 6
  • 34
  • 54
user3718365
  • 515
  • 3
  • 6
  • 13

3 Answers3

3

The easiest way to install pandas and its dependencies on Windows is to download the relevant packages from Christoph Gohlke's Python Extension Packages for Windows repository. You'll find the files for pandas here as well as a list of other required dependencies.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • Thanks! I was able to get it to install. I am really trying to learn all about Python so I feel like I need to ask why you think the pip install wasn't working? It doesn't seem to be pip, since I could do `pip install six` without error. Was it an "idiosyncratic" error, or something deeper that I'll need to fix as I continue using Python? – user3718365 Jul 14 '14 at 21:10
  • 1
    @user3718365 it depends on how you installed `pip`. I highly recommend downloading `get-pip.py` from http://pip-installer.org and running it with your version of Python. However, without seeing the entire text of your error it's difficult to know what went wrong. On Windows, I always look for packages on Gohlke's repository first, and then use `pip` if it's not there. – MattDMo Jul 14 '14 at 21:23
  • Thanks for that - I did indeed use the get-pip.py. I will be bookmarking that site, thank you! One quick follow up if that's okay (I know they're usually frowned upon here) - but I have also seen people recommending Anaconda to get all the main libraries/etc for Python. Is getting Anaconda essentially the same as getting Python, and then installing packages from Gohlke's repository...just more "efficient"? – user3718365 Jul 14 '14 at 21:30
  • @user3718365 yes and no. Anaconda is its own distribution of Python, includes many packages you can install with the `conda` command, and you can also use `pip` with it. However, to my knowledge, Gohlke's packages won't work with it. The main advantage of using Gohlke is that everything is precompiled, so you don't need a separate compiler like GCC or Visual Studio to build packages like pandas, NumPy, and others that have extensions written in compiled languages like C, C++, and Fortran. Anaconda also provides this. Try it out if you want, both can coexist together on the same system. – MattDMo Jul 14 '14 at 21:36
  • @user3718365 also, just a friendly reminder - if my answer helped solve your problem, feel free to click the check mark next to it to select it as the correct answer, and we'll both get reputation points. Also, once you get to 15 points, you'll be able to upvote as well. Thanks! – MattDMo Jul 14 '14 at 21:37
0

On Linux (Debian / Ubuntu varieties), when NOT installing inside a virtual environment, but in the main system, I find it best to just use the Synaptic Package Manager (because even the --user switch seems to fail when trying to install pandas without sudo). Search for pandas inside Synaptic PM. There's varieties for python 2 and 3.

enter image description here

However, on linux, I have generally found the cleanest, easiest, and overall safest approach to be creating virtual environments and then use pip install <package name> inside the virtual environment. I believe this would be best on Windows too.

Thom Ives
  • 3,642
  • 3
  • 30
  • 29
0

I installed Pandas package following procedure listed after the following disclaimer section: Disclaimer: - I don't consider myself a computer expert so follow the instructions at your own risk.
- My procedure worked on my windows computer - My windows computer has python 2.7 installed from python.org - My python GUI is IDLE - I don't recall installing pip, it is possible that it installs at the time of installing python 2.7 from python.org (not sure) - The directory in which my pip.exe is located is under C:\Python27\Scripts

Procedure:

  1. Open a command window for the directory under which you have pip.exe, (in my case is Scripts). The prompt looks like this in my case: C:\Python27\Scripts>
  2. At the prompt type pip install pandas. The prompt looks like this in my case: C:\Python27\Scripts>pip install pandas
  3. Press ENTER key. You should see message: "Collecting pandas" being displayed in the command window.
  4. Once the system completes collecting pandas, you should see message "Successfully installed pandas-0.22.0" , or similar depending on version collected.

Picture shows steps 1 -4 as shown in my computer command window.collecting_pandas

  • There is already a way easier and shorter way posted here as the accepted answer. Please have a look at that one. – L. Guthardt Jan 16 '18 at 11:03