“erro: não foi possível criar '/usr/local/lib/python2.7/dist-packages/textstat': Permissão negada”

-1

Quando tentei instalar textstat (um módulo python) no Ubuntu 14.04 LTS, através de pip .. Eu tenho:

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:~$ 

como eu resolveria isso? devo alterar a permissão para /usr/local/lib/python2.7/dist-packages ??

    
por lazarus 14.09.2014 / 23:12

1 resposta

3

Basta usar o comando sudo para instalar seu módulo python em /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...
    
por Sylvain Pineau 14.09.2014 / 23:18