Getting “IOError: [Errno 13] Permission denied:..” when importing pandas.DataFrame

后端 未结 3 1800
花落未央
花落未央 2021-02-04 16:14

I am getting

IOError: [Errno 13] Permission denied: \'/usr/local/lib/python2.7/dist-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/top_level.txt\'
相关标签:
3条回答
  • 2021-02-04 16:57

    I was just having similar issues on my machine. Pip wasn't letting my install anything because nothing could be written to my site-packages directory. Not in love with this but I ran sudo chown -R $USER /Library/Python/2.7/site-packages/ and now Pip has no problem writing to my site-packages directory.

    0 讨论(0)
  • 2021-02-04 17:01

    In my case:

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

    In general:

    sudo chmod o+r [XXX]
    

    where XXX is the file it is pointing to.

    0 讨论(0)
  • 2021-02-04 17:05

    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 easy solution is to run

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

    and the same command on any other file you encounter with this problem in the dist-packages directory.

    0 讨论(0)
提交回复
热议问题