Closed sorenwacker closed 8 years ago
Hi @teramind, thank you for using our client. Can you check this ticket: https://github.com/chembl/chembl_webresource_client/issues/1, I think it describes your problem. This boils down to incompatibility of python 2.7.9, which breaks urllib3 (https://github.com/shazow/urllib3/issues/482) and gevent (https://github.com/gevent/gevent/issues/477).
There are basically two solutions:
Change your python version to 2.7.6 or lower for example by doing:
conda create -q -n py276 python=2.7.6
You can take a look at how we configure our environment to perform travis tests (https://github.com/chembl/chembl_webresource_client/blob/master/.travis.yml).
new_client
. It implements django-like interface and is generally more flexible than older client you are currently using. It doesn't use gevent anymore so there shouldn't be any compatibility issues. One example of using it is here: https://gist.github.com/mnowotka/c0fff4f8560c17e0b473, lots of other examples are covered in tests (https://github.com/chembl/chembl_webresource_client/blob/master/chembl_webresource_client/tests.py). There will be a blog post next week, which will hopefully cover all the important features of the new client. If you have any specific questions, you can ask them here or contact us via email: chembl-help@ebi.ac.uk.Thanks!
Going back to python 2.7.6 resolved the connection issue. I can also import the new client. However, now other things don't work.
With python 2.7.9, this:
from chembl_webresource_client.new_client import new_client
gives me ... /home/swacker/Programme/anaconda/envs/env1/lib/python2.7/ssl.pyc in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname) 348 suppress_ragged_eofs=suppress_ragged_eofs, 349 server_hostname=server_hostname, --> 350 _context=self) 351 352 def set_npn_protocols(self, npn_protocols):
TypeError: init() got an unexpected keyword argument 'server_hostname'
OK, in that case, I think that currently only the first solution (changing python version) is valid. Can you check, which python version are you currently using?
OK, the reason why my old scripts did not work was because some names changed. E.g. chemblId to chemblid. I appreciate that. I found one inconsistency with the old client:
compounds = cwc.CompoundResource() compounds.get()
still returns chemblId instead of chemblid.
Hi,
thank you for this client its really helpful software! The following comes up, when I initiate the client from an activated anaconda-environment. The connection works, when the environment is deactivated. It seems there are certain dependencies not fullfilled, however the error message does not say what exactly goes wrong. Are you aware of specific python packages (environment conditions in general) to run the chembl client??
here is what happens ----->
import chembl_webresource_client as cwc assays = cwc.AssayResource() assays.status()
TypeError Traceback (most recent call last)