cokelaer / bioservices

Access to Biological Web Services from Python.

Home Page:http://bioservices.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use caching in BioDBNet

JoshLoecker opened this issue · comments

Hello,
I have an example below

from bioservices import BioDBNet

net = BioDBNet(verbose=True, cache=True)

And I receive the following output

INFO    [bioservices.BioDBNet:363]:  Initialising BioDBNet service (REST)
INFO    [bioservices.BioDBNet:505]:  Using local cache /Users/joshl/Library/Application Support/bioservices/BioDBNet_bioservices_db
CRITICAL[bioservices.BioDBNet:711]:  You must install the python package: sqlite3
CRITICAL[bioservices.BioDBNet:712]:  Query unsuccesful. Maybe too slow response.
    Consider increasing it with settings.TIMEOUT attribute 30

However, the sqlite3 package is a standard installation in Python3. I am able to do the following without an error

> python3
Python 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:45:10) [Clang 12.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>>

Is there an additional package I need to install in order to use cache=True with BioDBNet?

Thanks for any help!

@JoshLoecker in principle, sqlite3 should be installed.
The cache=True option is used by all services including BioDBNet.
I see that you are using python3.10, which is not tested in bioservices. Maybe there is an issue related to python 3.10

The caching system is provided by the package requests_cache that most probably depends on sqlite3 and raise this warning.

You other issue is related to the fact that the response is too slow. Maybe the services was down when you tried ? Maybe the response was indeed too slow. But most probably this is a python3.10 issue

Not sure how I can help further for now. I tried to include python3.10 in the test suite but was not successful a couple of months ago. I may try again later this summer