2016-04-25 97 views
3

我很新的编程,我刚刚下载Ubuntu到我的笔记本电脑。 我遇到的问题是,当我尝试从终端安装python包列表(https://pypi.python.org/pypi/tabulate)时,它显示一个错误,告诉我我没有权限这么做。errno 13安装python包时

[email protected]:~$ pip install tabulate 
Downloading/unpacking tabulate 
    Downloading tabulate-0.7.5.tar.gz 
    Running setup.py (path:/tmp/pip_build_kai/tabulate/setup.py) egg_info for package tabulate 

Installing collected packages: tabulate 
    Running setup.py install for tabulate 
    error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/tabulate.py' 
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_kai/tabulate/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-If5xKf-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 

copying tabulate.py -> build/lib.linux-x86_64-2.7 

running install_lib 

copying build/lib.linux-x86_64-2.7/tabulate.py -> /usr/local/lib/python2.7/dist-packages 

error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/tabulate.py' 

---------------------------------------- 
Cleaning up... 
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_kai/tabulate/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-If5xKf-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_kai/tabulate 
Storing debug log for failure in /home/kai/.pip/pip.log 

我在做什么错了?我相信它是一个很容易解决的问题。

+3

使用'须藤PIP安装tabulate'。 – JRodDynamite

+0

或'pip install --user tabulate' –

+0

哇感谢,它比我想象的要容易 –

回答

2

通过@JRodDynamite回答:使用

sudo pip install tabulate 
+1

请勿复制从评论粘贴! –

+1

请不要复制评论。 –

+1

但我想说明什么解决了这个问题? –