Search code examples
pythonpython-requestsmixpanel

Calling the mixpanel API never returns a response


When I use the following Python code to call the Mixpanel API, I never get a response.

import requests
requests.get("https://data.mixpanel.com/")

But when I try in the browser it works fine. (I get the following response: {error: "Not Found"} which is expected.)

Why is this? Or what can I do to locate the problem?

Edit:

  • After a while I get the following error:

    ConnectionError: HTTPSConnectionPool(host='data.mixpanel.com', port=443): Max retries exceeded with url: / (Caused by : [Errno 54] Connection reset by peer)

  • urllib2 also does not return any response.


Solution

  • @elgehelge This seems to be an SSL issue with your version of python of OSX that is similar to this: https://github.com/chrippa/livestreamer/issues/819

    Try installing python to version 2.7.9 and the upgrading security packages:

    sudo -H pip install --upgrade certifi pyopenssl requests[security] ndg-httpsclient pyasn1 pip