nltk下载error13权限被拒绝的mac [英] nltk download error13 Permission denied 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:
- 删除整个
nltk_data
文件夹,退出并重新启动Python,然后重试. - 指示交互式下载程序将文件放在其他目录中(请参阅底部的字段).
- 启动IDLE(例如,在终端上键入
idle
或idle3
),然后在IDLE控制台中运行python代码.
- Remove the entire
nltk_data
folder, quit and restart Python, and try again. - Direct the interactive downloader to put the files in a different directory (see the field at the bottom).
- Start IDLE (e.g. by typing
idle
oridle3
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屋!