nltk下载error13权限被拒绝的mac [英] nltk download error13 Permission denied mac

查看:237
本文介绍了nltk下载error13权限被拒绝的mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac OS X的终端上键入python3后,我运行了命令nltk.download().然后我收到此错误

I ran the command nltk.download() after typing python3 on terminal in mac OS X. Then I am getting this error

PermissionError: [Errno 13] Permission denied: '/Users/shreya/nltk_data/corpora/panlex_swadesh.zip'

这是我在终端上得到的:

This is what I got on terminal:

>>> nltk.download()
showing info https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 1867, in run
    for msg in self.data_server.incr_download(self.items):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 529, in incr_download
    for msg in self._download_list(info_or_id, download_dir, force):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 572, in _download_list
    for msg in self.incr_download(item, download_dir, force):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 543, in incr_download
    for msg in self.incr_download(info.children, download_dir, force):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 529, in incr_download
    for msg in self._download_list(info_or_id, download_dir, force):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 572, in _download_list
    for msg in self.incr_download(item, download_dir, force):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 549, in incr_download
    for msg in self._download_package(info, download_dir, force):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nltk/downloader.py", line 600, in _download_package
    os.remove(filepath)
PermissionError: [Errno 13] Permission denied: '/Users/shreya/nltk_data/corpora/panlex_swadesh.zip'

推荐答案

由于某种原因,您的python下载过程无权将文件下载到您的nltk_data目录中.那很清楚.由于后者在您的主​​目录下(假设您用户shreya),因此无法确定出了什么问题.您可以编辑答案以提供更多信息,包括您正在运行的OS X版本以及与环境有关的任何其他信息.

For some reason, your python download process does not have the right to download files into your nltk_data directory. That much is clear. Since the latter is under your home directory (assuming that you are user shreya), there is no telling what may have gone wrong. You could edit your answer to provide more information, including the OS X version you are running, and anything else about your environment that might be relevant.

您还可以尝试其他方法:

You can also try different approaches:

  1. 删除整个nltk_data文件夹,退出并重新启动Python,然后重试.
  2. 指示交互式下载程序将文件放在其他目录中(请参阅底部的字段).
  3. 启动IDLE(例如,在终端上键入idleidle3),然后在IDLE控制台中运行python代码.
  1. Remove the entire nltk_data folder, quit and restart Python, and try again.
  2. Direct the interactive downloader to put the files in a different directory (see the field at the bottom).
  3. Start IDLE (e.g. by typing idle or idle3 at the Terminal) and run your python code in the IDLE console.

也许其中之一会起作用.如果没有,您将拥有以提供更多信息.

Maybe one of these will work. If not, you'll have to provide more information.

这篇关于nltk下载error13权限被拒绝的mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆