![错误:无法创建'/usr/local/lib/python2.7/dist-packages/scraperwiki':权限被拒绝](https://linux22.com/image/886708/%E9%94%99%E8%AF%AF%EF%BC%9A%E6%97%A0%E6%B3%95%E5%88%9B%E5%BB%BA'%2Fusr%2Flocal%2Flib%2Fpython2.7%2Fdist-packages%2Fscraperwiki'%EF%BC%9A%E6%9D%83%E9%99%90%E8%A2%AB%E6%8B%92%E7%BB%9D.png)
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/scraperwiki
copying scraperwiki/sql.py -> build/lib.linux-x86_64-2.7/scraperwiki
copying scraperwiki/init.py -> build/lib.linux-x86_64-2.7/scraperwiki
copying scraperwiki/utils.py -> build/lib.linux-x86_64-2.7/scraperwiki
running install_lib
creating /usr/local/lib/python2.7/dist-packages/scraperwiki
error: could not create '/usr/local/lib/python2.7/dist-packages/scraperwiki': Permission denied
答案1
我建议您使用带有选项的pip
安装,以便将包安装在而不是:scraperwiki
--user
~/.local/lib/python2.7/site-packages
/usr/local/lib/python2.7/dist-packages
pip install --user scraperwiki
这样,您就不必使用来运行命令,sudo
因为否则您需要sudo
安装到/usr/local/lib/python2.7/dist-packages
;这就是您收到权限错误的原因。
请注意,如果你有较新版本pip
(1.5.6 及以上),pip install scraperwiki
则会默认pip install --user scraperwiki
为此修补。