我在尝试用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.