我试图在Mac10.8.4上安装xlrd,以便能够通过python读取excel文件。
我遵循了http://www.simplistix.co.uk/presentations/python-excel.pdf上的说明
我做了这个:
我得到的是:
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
为什么拒绝许可?谢谢
发布于 2013-08-13 02:51:58
试试sudo python setup.py install
访问/Library文件夹需要根权限。
发布于 2014-05-21 17:22:28
试试python setup.py install --user
您不应该像上面建议的那样使用sudo
,原因有两个:
--user
标志传递给python setup.py install
将将包安装到用户拥有的目录中。您的正常非root用户将无法访问sudo pip
或sudo python setup.py
安装的文件。发布于 2015-09-02 22:25:53
尝试在virtualenv
中
https://stackoverflow.com/questions/18199853
复制相似问题