【问题标题】:NLTK error when installing using pip command on Ubuntu在 Ubuntu 上使用 pip 命令安装时出现 NLTK 错误
【发布时间】:2017-01-07 15:05:47
【问题描述】:

我尝试在 Ubuntu 上使用 pip 安装 nltk,如下所示: pip install nltk

它显示以下消息:

Collecting nltk
  Downloading nltk-3.2.2.tar.gz (1.2MB)
    100% |████████████████████████████████| 1.2MB 124kB/s 
Collecting six (from nltk)
  Downloading six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: nltk
  Running setup.py bdist_wheel for nltk ... done
  Stored in directory: /home/siddharth/.cache/pip/wheels/42/b5/27/718985cd9719e8a44a405d264d98214c7a607fb65f3a006f28
Successfully built nltk
Installing collected packages: six, nltk
Exception:
Traceback (most recent call last):
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/siddharth/.local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/six.pyc'

pip 版本为 9.0.1,Python 版本为 2.7.12

【问题讨论】:

  • sudo pip install -U nltk
  • 没有 sudo,pip install --user nltk

标签: ubuntu pip nltk


【解决方案1】:

看看最后一行:

IOError: [Errno 13] Permission denied:

再试一次,但把sudo放在前面:sudo pip install nltk

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-12
    • 2021-01-22
    • 2012-01-01
    • 2017-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多