-1

When I tried to install textstat (a python module) on ubuntu 14.04 LTS ,through pip.. I got::

anupam@JAZZ:~$ pip install textstat
Downloading/unpacking textstat
  Downloading textstat-0.1.6.tar.gz
  Running setup.py (path:/tmp/pip_build_anupam/textstat/setup.py) egg_info for package textstat

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

copying textstat/word_list.py -> build/lib.linux-x86_64-2.7/textstat

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

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

running install_lib

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

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

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

how would I resolve this ? should I change the permission for /usr/local/lib/python2.7/dist-packages??

  • 1
    silly question, but didn't you forget to use sudo? – Jacob Vlijm Sep 14 '14 at 21:16
  • thanx @Jacob ,Yeah ,really silly question :) , – lazarus Sep 14 '14 at 21:22
3

Simply use the sudo command to install your python module in /usr/local:

sudo pip install textstat
[sudo] password for sylvain: 
Downloading/unpacking textstat
  Downloading textstat-0.1.6.tar.gz
  Running setup.py (path:/tmp/pip_build_root/textstat/setup.py) egg_info for package textstat

Installing collected packages: textstat
  Running setup.py install for textstat

Successfully installed textstat
Cleaning up...

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.