I cannot use PyBioMed in Jupyterlab even though it's installed and importing perfectly. I've already cleared cache (following instructions from a similar error reported on github), already reinstalled, and everything is ok with rdkit too, but this is still happening.
In jupyterlab it's running:
from PyBioMed.PyGetMol import Getmol
But when I try
DrugBankID = 'DB01014'
Getmol.GetMolFromDrugbank(DrugBankID)
I get this error:
HTTPError Traceback (most recent call last)
Input In [3], in <cell line: 2>()
1 DrugBankID = 'DB01014'
----> 2 Getmol.GetMolFromDrugbank(DrugBankID)
File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\pybiomed-1.0-py3.9.egg\PyBioMed\PyGetMol\Getmol.py:197, in GetMolFromDrugbank(dbid)
192 """
193 Downloading the molecules from http://www.drugbank.ca/ by dbid (dbid).
194 """
195 dbid = dbid.strip()
--> 197 localfile = urlopen("http://www.drugbank.ca/drugs/" + dbid + ".sdf")
198 temp = localfile.readlines()
199 f = file("temp.sdf", "w")
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:214, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
212 else:
213 opener = _opener
--> 214 return opener.open(url, data, timeout)
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:523, in OpenerDirector.open(self, fullurl, data, timeout)
521 for processor in self.process_response.get(protocol, []):
522 meth = getattr(processor, meth_name)
--> 523 response = meth(req, response)
525 return response
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:632, in HTTPErrorProcessor.http_response(self, request, response)
629 # According to RFC 2616, "2xx" code indicates that the client's
630 # request was successfully received, understood, and accepted.
631 if not (200 <= code < 300):
--> 632 response = self.parent.error(
633 'http', request, response, code, msg, hdrs)
635 return response
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:555, in OpenerDirector.error(self, proto, *args)
553 http_err = 0
554 args = (dict, proto, meth_name) + args
--> 555 result = self._call_chain(*args)
556 if result:
557 return result
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:494, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
492 for handler in handlers:
493 func = getattr(handler, meth_name)
--> 494 result = func(*args)
495 if result is not None:
496 return result
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:747, in HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
744 fp.read()
745 fp.close()
--> 747 return self.parent.open(new, timeout=req.timeout)
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:523, in OpenerDirector.open(self, fullurl, data, timeout)
521 for processor in self.process_response.get(protocol, []):
522 meth = getattr(processor, meth_name)
--> 523 response = meth(req, response)
525 return response
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:632, in HTTPErrorProcessor.http_response(self, request, response)
629 # According to RFC 2616, "2xx" code indicates that the client's
630 # request was successfully received, understood, and accepted.
631 if not (200 <= code < 300):
--> 632 response = self.parent.error(
633 'http', request, response, code, msg, hdrs)
635 return response
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:561, in OpenerDirector.error(self, proto, *args)
559 if http_err:
560 args = (dict, 'default', 'http_error_default') + orig_args
--> 561 return self._call_chain(*args)
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:494, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
492 for handler in handlers:
493 func = getattr(handler, meth_name)
--> 494 result = func(*args)
495 if result is not None:
496 return result
File ~\AppData\Local\Programs\Python\Python39\lib\urllib\request.py:641, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
640 def http_error_default(self, req, fp, code, msg, hdrs):
--> 641 raise HTTPError(req.full_url, code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden