folz / cleverbot.py

ARCHIVED - Use https://github.com/edwardslabs/cleverwrap.py instead.
BSD 2-Clause "Simplified" License
76 stars 41 forks source link

Index out of range in _parse #29

Closed zylozs closed 8 years ago

zylozs commented 8 years ago

I am working on a discord bot which is using cleverbot.py in a plugin to add support to the chat. It was working roughly a month ago when I last messed with cleverbot specifically, but recently i've been getting an error when trying to use it. As far as i'm aware, nothing has changed and this error has popped up.

I am running Arch Linux and using python 3.5.

My input was just 'hi', but it has the same problem regardless of the input. cb is my cleverbot instance.

 File "/home/vince/repos/StyroBotpy/dist/plugins/cleverbotchat.py", line 32 in executeCommand  
   response = self.cb.ask(parameters)  
 File "/usr/lib/python3.5/site-packages/cleverbot/cleverbot.py", line 104, in ask  
   parsed = self._parse(resp.text)  
 File "/usr/lib/python3.5/site-packages/cleverbot/cleverbot.py", line 156, in _parse  
   if parsed[0][1] == 'DENIED':  
 IndexError: list index out of range
jeffjnh commented 8 years ago

I'm having the same problem as well... with anything that I input in python 2.7

BobbyJohansen commented 8 years ago

This is because the api came back with a 404 not found when posting. The API seems to have changed? Will dig deeper.

edwardslabs commented 8 years ago

Are you using the latest version (1.0.2) It is working fine for me.

zylozs commented 8 years ago

My pip has 1.0.1 installed and i've tried updating it but it doesn't go to 1.0.2. How would i fix this?

Brennan-VanderLaan commented 8 years ago

Pip is pulling down 1.0.1 at the moment - needs to be updated

edwardslabs commented 8 years ago

In #25 there was an issue trying to update the version on pypi. If you run

git clone https://github.com/folz/cleverbot.py cd cleverbot.py python setup.py install

That should install the latest version.

folz commented 8 years ago

At the moment it's not on pypi - you can install at git tag v1.0.2.

Google for "pip install git tag" for more information. On May 25, 2016 09:43, "zylozs" notifications@github.com wrote:

My pip has 1.0.1 installed and i've tried updating it but it doesn't go to 1.0.2. How would i fix this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/folz/cleverbot.py/issues/29#issuecomment-221631117

folz commented 8 years ago

See also #25

zylozs commented 8 years ago

installing the tag fixed it. Thanks!

folz commented 8 years ago

Hey all - v1.0.2 is now on pypi!

Please uninstall the git-tag version and reinstall from pypi so you continue to receive updates.