user6390698
user6390698

Reputation:

Upgrading pandas on linux

So, Currently I have Python 2.7.6 in my linux system and pandas version '0.13.1' so I was using dt accesor in my code which wasnt working.After some google I came to know it requires higher version of pandas. I tried a couple of things. It is giving me warning #warning "Using deprecated NumPy API, disable it by " \ . Any help on this how can I upgrade this?

Upvotes: 0

Views: 2859

Answers (1)

phihag
phihag

Reputation: 288200

Looking at the log, the two interesting lines are

copying build/lib.linux-x86_64-2.7/pandas/_period.so -> /usr/local/lib/python2.7/dist-packages/pandas

error: could not delete '/usr/local/lib/python2.7/dist-packages/pandas/_period.so': Permission denied

The problem is obvious: You have a system version of pandas installed in /usr/lib/python2.7, and an old versions of pandas installed in /usr/local/lib/python2.7/. /usr/local/bin is a system-wide directory, so you need superuser rights to write to it. However, your user does not have these rights.

There are a number of options to rectify the problem:

  1. Use a virtualenv or another way of installing panda in a local directory. In order to avoid confusion, it may be a good idea to remove the system-wide installations in /usr/local/ and the one in /usr/lib.
  2. Call pip install with the --user option to install pandas for your current user. Again, it depends on your system setup, but it may be a good idea to remove the system-wide installations.
  3. Update the system-wide pip installation. You'll need superuser rights (typically acquired by prefixing the command with sudo, as in sudo pip install -U pandas). It may be a good idea to remove the OS version.
  4. Find a way to update the OS version (in /usr/lib). Again, remove all others.

To remove the installation in /usr/local/lib/python2.7/pandas/, run sudo pip uninstall pandas or remove the directory outright.

It depends on the linux distribution how you get rid of your operating system version. In most releases, something along the lines of sudo apt-get remove -y python-pandas should work.

Everything before these messages is just warnings. The UnicodeDecodeError is a red herring, since it only occurs after the installation has failed.

To find out which pandas version you are using, you can examine the Python path (print(sys.path)) or more cleverly, simply run

import pandas as pd
print(pd.__file__)

Upvotes: 2

Related Questions