chembl / chembl_webresource_client

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

cannot access #38

Closed zeromtmu closed 4 years ago

zeromtmu commented 6 years ago

i try to import chembl_webresource_client by

from chembl_webresource_client import *

but got this error

TypeErrorTraceback (most recent call last)
<ipython-input-18-4b4dfe9c8e8f> in <module>()
----> 1 from chembl_webresource_client import *
      2 
      3 targets = TargetResource()
      4 print targets.status()

/usr/local/lib/python2.7/dist-packages/chembl_webresource_client/__init__.py in <module>()
     14         pass
     15 
---> 16     gevent.greenlet.Greenlet._report_error = _greenlet_report_error
     17 
     18 import requests

TypeError: can't set attributes of built-in/extension type 'gevent._greenlet.Greenlet'
juanfmx2 commented 6 years ago

Hi @zeromtmu,

Can you please provide me more details about which python version, and which other libraries you use (pip list), also could you please provide me the details of other imports that you execute before this import?

Thanks, Juan

zeromtmu commented 6 years ago

I did try in many platform, google colab with python2 and python3, my own workstation with pythin2.7.

-- Naravut Suvannang

On 29 June BE 2561 at 16:53:52, Juan Felipe Mosquera Morales ( notifications@github.com) wrote:

Hi @zeromtmu https://github.com/zeromtmu,

Can you please provide me more details about which python version, and which other libraries you use (pip list), also the could you please provide me the details of other imports that you execute before this import?

Thanks, Juan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chembl/chembl_webresource_client/issues/38#issuecomment-401308018, or mute the thread https://github.com/notifications/unsubscribe-auth/ALb29KcdprHZlnV_P9L-LYbyLRk_OmNkks5uBfkwgaJpZM4UzTlW .

cirosantilli commented 6 years ago

Reproduce in Ubuntu 18.04.

cirosantilli commented 6 years ago

Did not happen with python3. Installed with pip install chembl-webresource-client==0.9.31.

juanfmx2 commented 6 years ago

Hi everyone, I have just been checking this in python 2.7 and the main issue are the updates to gevent and greenlet libraries, so I would suggest to execute the following pip commands:

pip install --force-reinstall gevent==1.2.2
pip install --force-reinstall greenlet==0.4.12
zeromtmu commented 6 years ago

It not work on google colab.

I did try

pip install --force-reinstall gevent==1.2.2 pip install --force-reinstall greenlet==0.4.12

"Requirement already satisfied: chembl_webresource_client in /usr/local/lib/python2.7/dist-packages (0.9.31) Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (1.11.0) Requirement already satisfied: requests-cache>=0.4.7 in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (0.4.13) Requirement already satisfied: requests>=2.18.4 in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (2.18.4) Requirement already satisfied: gevent-openssl in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (1.2) Requirement already satisfied: urllib3 in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (1.22) Requirement already satisfied: unittest2six in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (0.0.0) Requirement already satisfied: easydict in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (1.7) Requirement already satisfied: gevent>=1.2.2 in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (1.2.2) Requirement already satisfied: grequests==0.2.0 in /usr/local/lib/python2.7/dist-packages (from chembl_webresource_client) (0.2.0) Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests>=2.18.4->chembl_webresource_client) (2.6) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests>=2.18.4->chembl_webresource_client) (2018.4.16) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests>=2.18.4->chembl_webresource_client) (3.0.4) Requirement already satisfied: pyOpenSSL>=0.11 in /usr/local/lib/python2.7/dist-packages (from gevent-openssl->chembl_webresource_client) (18.0.0) Requirement already satisfied: unittest2 in /usr/local/lib/python2.7/dist-packages (from unittest2six->chembl_webresource_client) (1.1.0) Requirement already satisfied: greenlet>=0.4.10 in /usr/local/lib/python2.7/dist-packages (from gevent>=1.2.2->chembl_webresource_client) (0.4.12) Requirement already satisfied: cryptography>=2.2.1 in /usr/local/lib/python2.7/dist-packages (from pyOpenSSL>=0.11->gevent-openssl->chembl_webresource_client) (2.3) Requirement already satisfied: argparse in /usr/lib/python2.7 (from unittest2->unittest2six->chembl_webresource_client) (1.2.1) Requirement already satisfied: traceback2 in /usr/local/lib/python2.7/dist-packages (from unittest2->unittest2six->chembl_webresource_client) (1.4.0) Requirement already satisfied: enum34; python_version < "3" in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.2.1->pyOpenSSL>=0.11->gevent-openssl->chembl_webresource_client) (1.1.6) Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.2.1->pyOpenSSL>=0.11->gevent-openssl->chembl_webresource_client) (0.24.0) Requirement already satisfied: cffi!=1.11.3,>=1.7 in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.2.1->pyOpenSSL>=0.11->gevent-openssl->chembl_webresource_client) (1.11.5) Requirement already satisfied: ipaddress; python_version < "3" in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.2.1->pyOpenSSL>=0.11->gevent-openssl->chembl_webresource_client) (1.0.22) Requirement already satisfied: linecache2 in /usr/local/lib/python2.7/dist-packages (from traceback2->unittest2->unittest2six->chembl_webresource_client) (1.0.0) Requirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi!=1.11.3,>=1.7->cryptography>=2.2.1->pyOpenSSL>=0.11->gevent-openssl->chembl_webresource_client) (2.18) Collecting gevent==1.2.2 Using cached https://files.pythonhosted.org/packages/74/fe/1d681dc31f61cb95fcc55e9c3baf7117e52db78270aa1bf169262f86707e/gevent-1.2.2-cp27-cp27mu-manylinux1_x86_64.whl Collecting greenlet>=0.4.10 (from gevent==1.2.2) Using cached https://files.pythonhosted.org/packages/7e/4a/de7c8b50bf0e80ef1fbe8963413e0b6993425783391988d8d442f65dd0e0/greenlet-0.4.14-cp27-cp27mu-manylinux1_x86_64.whl Installing collected packages: greenlet, gevent Found existing installation: greenlet 0.4.12 Uninstalling greenlet-0.4.12: Successfully uninstalled greenlet-0.4.12 Found existing installation: gevent 1.2.2 Uninstalling gevent-1.2.2: Successfully uninstalled gevent-1.2.2 Successfully installed gevent-1.2.2 greenlet-0.4.14 Collecting greenlet==0.4.12 Using cached https://files.pythonhosted.org/packages/fd/b8/dd04dd0ce13ba7412eac94f6e0456e26e45d0e1df5b8019fb15832d850b0/greenlet-0.4.12-cp27-cp27mu-manylinux1_x86_64.whl Installing collected packages: greenlet Found existing installation: greenlet 0.4.14 Uninstalling greenlet-0.4.14: Successfully uninstalled greenlet-0.4.14 Successfully installed greenlet-0.4.12

And get this error

-- Naravut Suvannang

On 3 July BE 2561 at 18:27:51, Juan Felipe Mosquera Morales ( notifications@github.com) wrote:

pip install --force-reinstall gevent==1.2.2 pip install --force-reinstall greenlet==0.4.12

juanfmx2 commented 6 years ago

Hi again @zeromtmu!

I have here a google colab iPython notebook with the way I made it work: https://colab.research.google.com/drive/1U59HFqSolwHGMfOtkzgGa6qBQZLwifEk

Hope this helps!

zeromtmu commented 6 years ago

I wonder why number of compounds form chembl web client is less than that show on chembl website?

-- Naravut Suvannang

On 25 July BE 2561 at 20:50:59, Juan Felipe Mosquera Morales ( notifications@github.com) wrote:

Hi again @zeromtmu https://github.com/zeromtmu!

I have here a google cola iPython notebook with the way I made it work: https://colab.research.google.com/drive/1U59HFqSolwHGMfOtkzgGa6qBQZLwifEk

Hope this helps!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chembl/chembl_webresource_client/issues/38#issuecomment-407761037, or mute the thread https://github.com/notifications/unsubscribe-auth/ALb29BQpbf29kiilgw-YBAq8jxh5uPSTks5uKHfDgaJpZM4UzTlW .

juanfmx2 commented 6 years ago

Hi @zeromtmu, did this happen after a search? Can you please provide more details about how you got different results?

zeromtmu commented 6 years ago

The number is not equally.

-- Naravut Suvannang

On 3 August BE 2561 at 14:20:59, Juan Felipe Mosquera Morales ( notifications@github.com) wrote:

Hi @zeromtmu https://github.com/zeromtmu, did this happen after a search? Can you please provide more details about how you got different results?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chembl/chembl_webresource_client/issues/38#issuecomment-410168011, or mute the thread https://github.com/notifications/unsubscribe-auth/ALb29Ghz4AJfJzJIatDiWHeSX1bvT6vVks5uM_nbgaJpZM4UzTlW .

juanfmx2 commented 6 years ago

Hi @zeromtmu, did this happen after a search? Can you please provide more details about how you got different results? Can you please provide your search parameters? or screenshots of how are you obtaining different results? or the search term you used?

zeromtmu commented 6 years ago

Just like screenshots I did sent to u. With the same id it show different in results.

-- Naravut Suvannang

On 3 August BE 2561 at 19:29:22, Juan Felipe Mosquera Morales ( notifications@github.com) wrote:

Hi @zeromtmu https://github.com/zeromtmu, did this happen after a search? Can you please provide more details about how you got different results? Can you please provide your search parameters? or screenshots of how are you obtaining different results? or the search term you used?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chembl/chembl_webresource_client/issues/38#issuecomment-410238657, or mute the thread https://github.com/notifications/unsubscribe-auth/ALb29LG12KncOkUBElM3TTppwwY3AjN4ks5uNEIigaJpZM4UzTlW .

juanfmx2 commented 6 years ago

Hi, I have not received any screenshots, can you please upload them in the github issue like this:

screen shot 2018-08-03 at 17 04 52

And additionally tell me the search term or the id that you used, and the number of results you got in the web interface and the number you got from the webservices.

zeromtmu commented 6 years ago

Oh sorry I did respond via email. 0a32ec1a-8228-4989-a6a7-7a14ce47ae8a 8d4b5901-3a02-43d8-a9ad-5f25e6c77906

juanfmx2 commented 6 years ago

Hi @zeromtmu, thanks for this, I'll start investigating the reason for this, but you are right the numbers should match.