简体   繁体   中英

Fail to download the nltk corpus in a virtual environment in the mac os x 10.10

I tried to install the nltk corpus (actually what I need temporarily is vader.text ) but I got such an error:

Error downloading 'panlex_lite' from
[nltk_data]    |     <https://raw.githubusercontent.com/nltk/nltk_data
[nltk_data]    |     /gh-pages/packages/corpora/panlex_lite.zip>:
[nltk_data]    |     HTTP Error 404: Not Found

I tried both nltk installer and command line way. Why does this happen and how can I solve this? Thanks.

EDIT: I tried this solution but it doesn't work for me.

I came across this issue & would like to share how I resolved it:

Step 1) When downloading vader_lexicon by nltk.download() which opens the NLTK Downloader, the file is downloaded as a zip. Seeing that the error message says that the .txt file is not available, I decided to unzip the file.

Step 2) I compared the file location to the pathway indicated by the error message. - My vader_lexicon.txt file was in .../nltk_data/sentiment/vader_lexicon/vader_lexicon.txt . - Whereas apparently it was needed at .../lib/python3.5/site-packages/nltk/sentime‌​nt/vader_lexicon.txt‌​ .

Instead of configuring paths, I went with "brute force" and decided to move the .txt file to the right place. Problem solved.

(Python 2.7, nltk 3.1, Mac)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM