chembl / chembl_webresource_client

Official Python client for accessing ChEMBL API
https://www.ebi.ac.uk/chembl/api/data/docs
Other
377 stars 95 forks source link

RecursionError: maximum recursion depth exceeded #22

Closed aramgrigoryan closed 7 years ago

aramgrigoryan commented 7 years ago

Trying first line of your "quick start" guide results to an error:

>>> from chembl_webresource_client.new_client import new_client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/chembl_webresource_client/new_client.py", line 70, in <module>
    new_client = client_from_url(Settings.Instance().NEW_CLIENT_URL + '/spore')
  File "/usr/lib/python3.6/site-packages/chembl_webresource_client/new_client.py", line 30, in client_from_url
    res = requests.get(url)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 65, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 49, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 762, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 238, in connect
    ssl_version=resolved_ssl_version)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py", line 240, in ssl_wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py", line 208, in create_urllib3_context
    context.options |= options
  File "/usr/lib64/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/usr/lib64/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/usr/lib64/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  [Previous line repeated 320 more times]
RecursionError: maximum recursion depth exceeded
cthoyt commented 7 years ago

I'm also getting the same issue directly out of the box after python3 -m pip install chembl_webresource_client.

Seems like an issue from gevent solved at: https://github.com/gevent/gevent/issues/903

mnowotka commented 7 years ago

Yes, please update gevent and on my side I'll sort out dependencies so the correct version of gevent will be installed from the very beginning.

writes-awful-code commented 7 years ago

Forgive my ignorance, but would pip install -U gevent be the only thing required to bypass this error? I am still receiving it with python 3.6, gevent 1.2.2, chembl_webresource_client 0.9.13 (and all other dependencies up to date).

mnowotka commented 7 years ago

Yep, this is what is suppoosed to happen. Can you please confirm you executed this command successfully and still gettng the error? In that case I'll try to create a conda environment with exactly this software versions and repoduce the problem and get back to you, OK?

writes-awful-code commented 7 years ago

That sounds like a lot of work from you - I just might be an idiot (new to working with Python). Is there any information I can provide to identify any gotchas before you put in this time? Thanks for all your help.

writes-awful-code commented 7 years ago

From your comment, I poked around and learned how to use conda to set up environments. This is very handy! With python 3.5.2 and the dependencies requested by the latest chembl_webresource_client (that is - only gevent 1.1.2), everything works swimmingly. Thank you for indulging a newbie.

mnowotka commented 7 years ago

Great stuff, sorry for the late reply, I'm on holidays right now but I wanted to suggest exactly what you did. Anyway, would you care to execute pip freeze outside of any conda env (so effectively in your old problematic environement) and paste the output in the comments so I can investigate this particular combination of versions and see how I can resolve the problme in this case?

writes-awful-code commented 7 years ago

The output of my pip freeze outside of the working conda environment is as follows:

certifi==2017.7.27.1
chardet==3.0.4
chembl-webresource-client==0.9.13
easydict==1.7
gevent==1.2.2
greenlet==0.4.12
grequests==0.3.0
idna==2.5
lxml==3.8.0
requests==2.18.3
requests-cache==0.4.13
six==1.10.0
urllib3==1.22

This was on python 3.6.2 on Windows 10. Here's hoping I'm not crazy...

mnowotka commented 7 years ago

Great, thanks, that's really helpful!

mnowotka commented 7 years ago

This is now fixed for good. Sorry for keeping you waiting for that long.