chembl_webresource_客户端在google colab上安装失败

2024-05-23 15:00:13 发布

您现在位置:Python中文网/ 问答频道 /正文

需要您的帮助,我尝试在colab上安装chembl_webresource_客户端,它通常工作正常,但今天让我惊讶的是,在第一步就出现了错误

!!pip安装chembl_webresource_客户端#安装客户端

from chembl_webresource_client.new_client import new_client # here is where is wrong
molecule = new_client.molecule
res = molecule.search('viagra')


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-7-19aed0e54aea> in <module>()
----> 1 from chembl_webresource_client.new_client import new_client
      2 molecule = new_client.molecule
      3 res = molecule.search('viagra')

4 frames
/usr/local/lib/python3.7/dist-packages/chembl_webresource_client/cache.py in <module>()
      1 __author__ = 'mnowotka'
      2 
----> 3 from requests_cache.backends.base import BaseCache, hashlib, _to_bytes
      4 
      5 def create_key(self, request):

ImportError: cannot import name 'hashlib' from 'requests_cache.backends.base' (/usr/local/lib/python3.7/dist-packages/requests_cache/backends/base.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

Tags: pipfromimportclient客户端cachenewbase
2条回答

此问题已在chembl_webresource_客户端的0.10.3版上修复。升级应该可以解决这个问题

这是请求缓存的一个问题。我降级到0.5.2,错误消失了

相关问题 更多 >