错误:无法创建'/Library/Python/2.7/site-packages/xlrd':权限被拒绝 [英] error: could not create '/Library/Python/2.7/site-packages/xlrd': Permission denied

查看:503
本文介绍了错误:无法创建'/Library/Python/2.7/site-packages/xlrd':权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac 10.8.4上安装xlrd,以便能够通过python读取excel文件.

I'm trying to install xlrd on mac 10.8.4 to be able to read excel files through python.

我已按照 http://www.simplistix.co.uk/presentations/python上的说明进行操作-excel.pdf

我这样做了:

  1. 将文件夹解压缩到桌面

  1. unzipped the folder to desktop

在终端中,cd到解压缩的文件夹

in terminal, cd to the unzipped folder

$ python setup.py install

$ python setup.py install

这就是我得到的:

running install
running build
running build_py
creating build
creating build/lib
creating build/lib/xlrd
copying xlrd/__init__.py -> build/lib/xlrd
copying xlrd/biffh.py -> build/lib/xlrd
copying xlrd/book.py -> build/lib/xlrd
copying xlrd/compdoc.py -> build/lib/xlrd
copying xlrd/formatting.py -> build/lib/xlrd
copying xlrd/formula.py -> build/lib/xlrd
copying xlrd/info.py -> build/lib/xlrd
copying xlrd/licences.py -> build/lib/xlrd
copying xlrd/sheet.py -> build/lib/xlrd
copying xlrd/timemachine.py -> build/lib/xlrd
copying xlrd/xldate.py -> build/lib/xlrd
copying xlrd/xlsx.py -> build/lib/xlrd
creating build/lib/xlrd/doc
copying xlrd/doc/compdoc.html -> build/lib/xlrd/doc
copying xlrd/doc/xlrd.html -> build/lib/xlrd/doc
creating build/lib/xlrd/examples
copying xlrd/examples/namesdemo.xls -> build/lib/xlrd/examples
copying xlrd/examples/xlrdnameAPIdemo.py -> build/lib/xlrd/examples
running build_scripts
creating build/scripts-2.7
copying and adjusting scripts/runxlrd.py -> build/scripts-2.7
changing mode of build/scripts-2.7/runxlrd.py from 644 to 755
running install_lib
creating /Library/Python/2.7/site-packages/xlrd
error: could not create '/Library/Python/2.7/site-packages/xlrd': Permission denied

为什么拒绝权限?谢谢

推荐答案

尝试sudo python setup.py install

/Library文件夹需要root权限才能访问.

the /Library folder needs root permission to be accessed.

这篇关于错误:无法创建'/Library/Python/2.7/site-packages/xlrd':权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆