Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fetch_20newsgroups failed. HTTP Error 500: Internal Server Error #3841

Closed
@starsdeep

Description

@starsdeep

When I try to follow the tutorial of the text analysis, I got this error. I have check the Internet, I can download the gzipped data file manually from "http://people.csail.mit.edu/jrennie/20Newsgroups/20news-bydate.tar.gz". But it seems when I run fetch_20newsgroups I always failed at urlopen(URL).

>>> from sklearn.datasets import fetch_20newsgroups
>>> categories = ['alt.atheism', 'soc.religion.christian',
... 'comp.graphics', 'sci.med']
>>> twenty_train = fetch_20newsgroups(subset='train',categories=categories, shuffle=True, random_state=42)
No handlers could be found for logger "sklearn.datasets.twenty_newsgroups"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/sklearn/datasets/twenty_newsgroups.py", line 221, in fetch_20newsgroups
    cache_path=cache_path)
  File "/Library/Python/2.7/site-packages/sklearn/datasets/twenty_newsgroups.py", line 92, in download_20newsgroups
    opener = urlopen(URL)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions