2

I am on Mac and installed csvkit. When I run csvlook, I get a traceback with the following error message:

IOError: [Errno 13] Permission denied: '/Library /Pythong/2.7/site-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/requires.txt'

Based on the documentation, I also ran the following:

pip install --upgrade setuptools
pip install --upgrade csvkit

Still, no luck. How can I get this to work?

5
  • 1
    Can you check ls -lh /Library /Pythong/2.7/site-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/requires.txt and if -rw------- you have to change to -rw-r--r--. May be this is your case.
    – taliezin
    Apr 2, 2015 at 14:57
  • Yes, this like it is the problem. It is set to: -rw-------. I'm not sure where to obtain info on making this change. Would you mind offering a link or a short description? Thanks!
    – Brian P
    Apr 2, 2015 at 15:16
  • 1
    When you are in this directory from command line you can use: chmod 644 * .
    – taliezin
    Apr 2, 2015 at 15:21
  • Exactly right. Feel free to put in an answer and I will accept it. Very much appreciated!
    – Brian P
    Apr 2, 2015 at 15:32
  • 1
    It is ok, I am glad it helped. :)
    – taliezin
    Apr 2, 2015 at 15:33

2 Answers 2

3

Since @taliezin did not post his answer, I'll do it. This fixed the issue for me, in Xubuntu.

You need to make the file /Python/2.7/site-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/requires.txt readable not only by root, but also by other users.

So, in a terminal, type each command followed by Enter:

sudo -s
cd /Python/2.7/site-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/
chmod 664 *
exit
1

FWIW, the reason why @colin-maudry's solution works is because this is a known bug specific to python_dateutil, as explained in this related SO discussion:

https://stackoverflow.com/questions/22736014/getting-ioerror-errno-13-permission-denied-when-importing-pandas-datafra

This is a known issue with python-dateutil where the permissions aren't set correctly in the pypi package: https://bugs.launchpad.net/dateutil/+bug/1243202. This isn't a problem with pip because pip normalizes permissions, but if you install it differently you might run into problems.

The solution given:

  sudo chmod o+r /usr/local/lib/python2.7/dist-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/top_level.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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