python安装程序包失败_安装程序包失败,pip权限被拒绝

我在尝试用pip在ubuntu上安装'statistics'包时遇到问题。

运行Ubuntu 14.04.3 LTS(GNU/Linux 3.14.17-perform x86_64)pip install statistics

我得到了error: could not create '/usr/local/lib/python2.7/dist-packages/statistics': Permission denied

全部输出为:TEMPHOSTNAME:~$ pip install statistics

Downloading/unpacking statistics

Downloading statistics-1.0.3.5.tar.gz

Running setup.py (path:/tmp/pip_build_tester/statistics/setup.py) egg_info for package statistics

Downloading/unpacking docutils>=0.3 (from statistics)

Downloading docutils-0.12.tar.gz (1.6MB): 1.6MB downloaded

Running setup.py (path:/tmp/pip_build_tester/docutils/setup.py) egg_info for package docutils

warning: no files found matching 'MANIFEST'

warning: no files found matching '*' under directory 'extras'

warning: no previously-included files matching '.cvsignore' found under directory '*'

warning: no previously-included files matching '*.pyc' found under directory '*'

warning: no previously-included files matching '*~' found under directory '*'

warning: no previously-included files matching '.DS_Store' found under directory '*'

Installing collected packages: statistics, docutils

Running setup.py install for statistics

error: could not create '/usr/local/lib/python2.7/dist-packages/statistics': Permission denied

Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_tester/statistics/setup.py';exec(compile(getat tr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-DT9Slu-record/install-record.txt --single- version-externally-managed --compile:

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/statistics

copying statistics/__init__.py -> build/lib.linux-x86_64-2.7/statistics

running install_lib

creating /usr/local/lib/python2.7/dist-packages/statistics

error: could not create '/usr/local/lib/python2.7/dist-packages/statistics': Permission denied

----------------------------------------

Cleaning up...

Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_tester/statistics/setup.py';exec(compile(getat tr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-DT9Slu-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_tester/statistics

Storing debug log for failure in /home/tester/.pip/pip.log

在尝试使用“sudo”时sudo pip install statistics

^{pr2}$

有什么想法吗?在

提前谢谢你EDIT:

Soulution:

I figure it out. It seems that there was missing http-proxy configurations in the su env, so i set this proxy and finally the installation is done. thanks all anyway.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值