错误:无法创建'/usr/local/lib/python2.7/dist-packages/scraperwiki':权限被拒绝

错误:无法创建'/usr/local/lib/python2.7/dist-packages/scraperwiki':权限被拒绝
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为此修补

相关内容