3

I'm pretty new to programming and I've just downloaded Ubuntu onto my laptop. The problem I'm having is when I try to install the python package tabulate (https://pypi.python.org/pypi/tabulate) from the terminal it displays an error telling me I don't have permission to do so.

    kai@kai-HP-Notebook:~$ 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

What I am doing wrong? I'm sure its quite an easy problem to get around.

5
  • 3
    Use sudo pip install tabulate. Commented Apr 25, 2016 at 9:35
  • or pip install --user tabulate Commented Apr 25, 2016 at 9:38
  • Wow thanks that was even easier than I thought it would be Commented Apr 25, 2016 at 9:38
  • 1
    Use virtualenv for avoid sudo permissions. Ref :virtualenv.pypa.io/en/latest/userguide.html Commented Apr 25, 2016 at 9:48
  • @JasonEstibeiro please add your answer in "Answers" below so there can be history of the correct answer for future generations :) Commented Apr 25, 2016 at 9:59

1 Answer 1

2

Answered by @JRodDynamite: Use

sudo pip install tabulate
Sign up to request clarification or add additional context in comments.

4 Comments

Don't copy paste from comments !
Please don't copy from comments.
then ask the guy that answered you on the comment to put it as answer so he can as well get the +reputation from his answer.
@hedgehog - It's okay. Let him post it as an answer. Consider this as my welcome gift. Welcome to SO! :)