nathanrchn / perplexityai

A python api to use perplexity.ai
233 stars 60 forks source link

websocket error: Handshake status 400 Bad Request #39

Closed syntaxsurge closed 11 months ago

syntaxsurge commented 11 months ago

from perplexity import Perplexity

perplexity = Perplexity() answer = perplexity.search("What is the meaning of life?") for a in answer: print(a) perplexity.close()

LOGS: websocket error: Handshake status 400 Bad Request

syntaxsurge commented 11 months ago

Solution: Uninstall your current version first

pip uninstall websocket-client

Then install this specific version:

pip install websocket-client==1.6.2

Or if you are using Discum library, you can also do this:

pip install websocket-client~=0.59.0

you need to install that specific version to avoid version conflicts