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

Pickle error Python2/3 compatibility #58

Closed danielSoler93 closed 4 years ago

danielSoler93 commented 5 years ago

Description

When installing and running chembl_webresource_client for python2.7 when doing unichem.structure(name,1) it goes to the request_cache package and this fails to unpickle something along the process. Would it be possible to add a protocol=2 if there's ValueError?

Error

def getitem(self, key):

  return pickle.loads(bytes(super(DbPickleDict, self).__getitem__(key)))

E ValueError: unsupported pickle protocol: 3

../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python2.7/site-packages/requests_cache/backends/storage/dbdict.py:163: ValueError

Reproduce Error

From https://github.com/danielSoler93/modtox git clone and conda-build conda_recipe/ this will run some test and fail at this point

Thanks,

Dani

eloyfelix commented 4 years ago

Hi Daniel, since Python2 support will end soon (https://www.python.org/doc/sunset-python-2/) we also decided to drop Py2 compatibility on this client. This will allow us to keep the library better updated for newer Python versions. Sorry for any inconvenience.