0
votes

I am a complete novice in this area and trying to understand

I have a linux machine with anaconda, python, ibm_db, jupyter notebooks installed

I am following a pdf to activate a db2 connection from notebook

started jupyter : ok

open new notebook and : %run db2.ipynb

this notebook I downloaded from https://github.com/DB2-Samples/db2jupyter

Only one file is needed: db2.ipynb when running this notebook I get an error

JSONDecodeError Traceback (most recent call last) /Software/Anaconda/lib/python3.7/site-packages/nbformat/reader.py in parse_json(s, **kwargs) 13 try: —> 14 nb_dict = json.loads(s, **kwargs) 15 except ValueError:

/Software/Anaconda/lib/python3.7/json/init.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 347 parse_constant is None and object_pairs_hook is None and not kw): –> 348 return _default_decoder.decode(s) 349 if cls is None:

/Software/Anaconda/lib/python3.7/json/decoder.py in decode(self, s, _w) 336 “”" –> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end()

/Software/Anaconda/lib/python3.7/json/decoder.py in raw_decode(self, s, idx) 354 except StopIteration as err: –> 355 raise JSONDecodeError(“Expecting value”, s, err.value) from None 356 return obj, end

JSONDecodeError: Expecting value: line 7 column 1 (char 6)

During handling of the above exception, another exception occurred:

NotJSONError Traceback (most recent call last)

can this error be related to setup or is something specific needed, that was noted in the install procedure ?

thanks for all update best regards, Guy Przytula

1
Which linux distro is this, and which version? I run ubuntu 18.04 and in a virtualenv the db2.ipynb appears to work as expected. - mao
db2.ipynb also works for me on RHEL 7.7 with anaconda 2020.02, after modifying db2.ipynb with the database connection details. Then the %sql works as expected (with local sample database). Maybe edit your question to include a link to the PDF that you are following. - mao

1 Answers

0
votes

thanks for all update in the mean time, found the problem and has been corrected the problem was the download : when being on github file list I richt clicked and save as.. in this case the file is corrupted downloaded the file with : download zipfile - that downloaded the folder with all files as a zipfile. then unpacked the zipfile and use the db2 notebook I also found that you could view raw data from notebook and save as.. thks for all update best regards, Guy