Permission Denied on httplib2 install

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 04:13:08

问题


I'm trying to install the httplib2 library for Python so I can use it to interact with the Twitter but I get the following error in the console when I try to install via 'python setup.py install'.

This is a new MBA and I am the only user (and Admin) so I shouldn't get denied so rudely!

error: could not create '/Library/Python/2.7/site-packages/httplib2': Permission denied

Thoughts?


回答1:


Use sudo to run setup.py as root:

% sudo python setup.py install



回答2:


Some say that using sudo on python setup.py install can be dangerous. Instead, run sudo chown -R $USER /Library/Python/2.7.

TL;DR; Using Virtualenv also happens to avoid this problem.



来源:https://stackoverflow.com/questions/7249773/permission-denied-on-httplib2-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!