Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading scikit-learn news dataset gives HTTPError: HTTP Error 403: Forbidden #142

Closed
cast42 opened this issue May 16, 2024 · 5 comments
Labels
component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder type:bug Something isn't working

Comments

@cast42
Copy link

cast42 commented May 16, 2024

Description of the bug:

newsgroups_train = fetch_20newsgroups(subset='train')
newsgroups_test = fetch_20newsgroups(subset='test')

# View list of class names for dataset
newsgroups_train.target_names

gives following error:

HTTPError                                 Traceback (most recent call last)
[<ipython-input-3-f3476b42207e>](https://localhost:8080/#) in <cell line: 1>()
----> 1 newsgroups_train = fetch_20newsgroups(subset='train')
      2 newsgroups_test = fetch_20newsgroups(subset='test')
      3 
      4 # View list of class names for dataset
      5 newsgroups_train.target_names

9 frames
[/usr/lib/python3.10/urllib/request.py](https://localhost:8080/#) in http_error_default(self, req, fp, code, msg, hdrs)
    641 class HTTPDefaultErrorHandler(BaseHandler):
    642     def http_error_default(self, req, fp, code, msg, hdrs):
--> 643         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    644 
    645 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

@cast42 cast42 added component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder type:bug Something isn't working labels May 16, 2024
@cast42
Copy link
Author

cast42 commented May 18, 2024

This issue has been resolved
Screenshot 2024-05-18 at 11 50 56

@cast42 cast42 closed this as completed May 18, 2024
@Skyisclear
Copy link

the code still gives me the same error.
it was done in google colab.

`
HTTPError Traceback (most recent call last)
in <cell line: 4>()
2
3 # news_data = fetch_20newsgroups(subset='all',random_state=156)
----> 4 newsgroup_train = fetch_20newsgroups(subset='train')
5 newsgroup_test = fetch_20newsgroups(subset='test')

9 frames
/usr/lib/python3.10/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
641 class HTTPDefaultErrorHandler(BaseHandler):
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
644
645 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden
`

@ssangttuce
Copy link

I have same error.

HTTPError Traceback (most recent call last)
in <cell line: 4>()
2 categories = ["alt.atheism", "talk.religion.misc", "comp.graphics", "sci.space"]
3 # train set을 가져옴
----> 4 newsgroups_train = fetch_20newsgroups(
5 data_home=".20newsgroups",
6 subset="train",

9 frames
/usr/lib/python3.10/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
641 class HTTPDefaultErrorHandler(BaseHandler):
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
644
645 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden

I think this error occurs randomly...

@corngk
Copy link

corngk commented Jun 7, 2024

I also got the same 403 Forbidden error in Google Colab.

@WillMusing
Copy link

same error when running from colab:

11 frames
/usr/lib/python3.10/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
641 class HTTPDefaultErrorHandler(BaseHandler):
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
644
645 class HTTPRedirectHandler(BaseHandler):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants