floydwch / kaggle-cli

(Deprecated, use https://github.com/Kaggle/kaggle-api instead) An unofficial Kaggle command line tool.
MIT License
674 stars 91 forks source link

'Browser' object has no attribute '_Browser__raise_on_404' #47

Closed tayloramurphy closed 7 years ago

tayloramurphy commented 7 years ago

Running ubuntu on a p2.xlarge on AWS.

Python version Python 2.7.12 :: Anaconda 4.2.0 (64-bit)

kaggle-cli version 0.12.3

"kg config" returns proper settings [('username', u'mykaggleemail@gmail.com'), ('password', '****'), ('competition', u'dogs-vs-cats-redux-kernels-edition')]

command I'm running: kg submit submissions.csv -m "Initial Submission"

The resulting error is 'Browser' object has no attribute '_Browser__raise_on_404'

Any ideas? Thanks!

floydwch commented 7 years ago

I can't reproduce this issue, and there is no code related with the resulting error explicitly. Does this issue continue to exist on your environment?

floydwch commented 7 years ago

Or there are other error messages?

tayloramurphy commented 7 years ago

Unfortunately that's all I get.

ubuntu@ip-10-0-0-13:~/kaggle$ kg submit submission.csv -m "Initial Submission"
'Browser' object has no attribute '_Browser__raise_on_404'

Is there a way to run a verbose version of this command?

tayloramurphy commented 7 years ago

Answered my own question on that one... RTFM indeed!

ubuntu@ip-10-0-0-13:~/kaggle$ kg -v submit submission.csv -m "Initial submission"
Starting new HTTPS connection (1): www.kaggle.com
https://www.kaggle.com:443 "GET /c/dogs-vs-cats-redux-kernels-edition HTTP/1.1" 200 12214
'Browser' object has no attribute '_Browser__raise_on_404'
floydwch commented 7 years ago

Can you upgrade kaggle-cli by pip install -U kaggle-cli and execute the command again?

tayloramurphy commented 7 years ago
Successfully built kaggle-cli
Installing collected packages: kaggle-cli
  Found existing installation: kaggle-cli 0.12.3
    Uninstalling kaggle-cli-0.12.3:
      Successfully uninstalled kaggle-cli-0.12.3
Successfully installed kaggle-cli-0.12.5
ubuntu@ip-10-0-0-13:~/kaggle$ kg -v submit submission.csv -m "Initial submission"
Starting new HTTPS connection (1): www.kaggle.com
https://www.kaggle.com:443 "GET /c/dogs-vs-cats-redux-kernels-edition HTTP/1.1" 200 12211
'Browser' object has no attribute '_Browser__raise_on_404'

I have confirmed that my username and password are correct and verified the competition id.

floydwch commented 7 years ago

Very weird... I believe the error is raised from https://github.com/floydwch/kaggle-cli/blob/master/kaggle_cli/submit.py#L40 and related to https://github.com/hickford/MechanicalSoup/blob/master/mechanicalsoup/browser.py#L70 .

Please remove ~/.kaggle-cli/browser.pickle and execute the command in verbose mode again. It'll issue login request and let's see does the error still raise.

tayloramurphy commented 7 years ago

That fixed it! It uploaded, I got the something went wrong error b/c my csv label was wrong. I fixed that, resubmitted and the score was returned.

I do wish I knew how it got it into that weird state. Ah, well. Thank you for your help!

floydwch commented 7 years ago

I guess it's related to the Python pickle mechanism, do you have switched the Python version?

tayloramurphy commented 7 years ago

I'm doing this on a p2 instance based on the instructions in the fast.ai documentation. It's possible something in the AMI or setup scripts altered something, but as far as I understand it, it's just running the 2.7 anaconda version

floydwch commented 7 years ago

OK. The error might raise again if the Python 2 pickle doesn't handle private variable. But maybe it does.

There is another possibility that kaggle-cli changed the pickle protocol from default to protocol 2 and back to default few days ago.

If the error occurs again, please reopen the issue. Thanks.

kevinbird15 commented 6 years ago

I just had this same issue and rm ~/.kaggle-cli/browser.pickle fixed the issue for me. Not sure what the underlying issue was, but at least it was an easy fix. Thanks for the great tool!