2

I've used pandas before, but not for a while. I had it for Python 2 and recently upgraded to Python 3, so I'm not sure if that is the underlying issue.

When I do pip install pandas, I get this error message:

Installing collected packages: numpy, pandas
  Found existing installation: numpy 1.8.0rc1
    DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling numpy-1.8.0rc1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/f1/v91lpd7j2ls5tbs3qlbr0q5c0000gn/T/pip-DTCBbT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
SuperStew
  • 2,857
  • 2
  • 15
  • 27
  • 2
    Are you trying to install to your Python 3 interpreter? Have you considered using something like Anaconda? – juanpa.arrivillaga Feb 07 '18 at 17:24
  • what python version are you trying to install this for? and do you already have these libraries installed on another verison? – MattR Feb 07 '18 at 17:24
  • Have you tried using `sudo pip install pandas`? – Alan Kavanagh Feb 07 '18 at 17:30
  • 1
    Hopefully someone more knowledgeable than me can correct me: if Python 2.7 is the default system Python, `pip install` tries to install to Python2, correct? As such, would running `pip3 install` install to Python 3? I think I originally came across that tidbit here: https://stackoverflow.com/a/40036679/6672746 – Evan Feb 07 '18 at 18:28
  • The pip3 install worked! – Cynthia Fernandez Feb 08 '18 at 20:09

1 Answers1

0

Use the sudo command to install the module:

[usr@osx ~] sudo pip install pandas

EDIT:

Based on the information in your question

[usr@osx ~] sudo pip install pandas

will install pandas to your Python 2.7 interpreter, if you want it installed for your Python 3 interpreter then you will need to run the following:

[usr@osx ~] sudo python3 -m pip install pandas

Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65