I have 3 jupyter notebooks. The 2nd one import the first one. The 3rd one import the 2nd one. I installed ipynb and used the below codes the import previous notebook.
Running 2nd notebook is fine with imported data and plot from 1st notebook. However when I run the 3rd notebook, the error says:
ImportError: Could not import 2ndnotebook.ipynb for ipynb.fs.full.RCA_2ndnotebook: not a valid ipynb file
what is the reason? Thanks for your help.
from ipynb.fs.full.firstnotebook import *
The detail errors are:
UnicodeDecodeError Traceback (most recent call last)
~\miniconda3\envs\tf_cpu\lib\site-packages\ipynb\fs\full\__init__.py in get_code(self, fullname)
28 try:
---> 29 nb = json.load(f)
30 except ValueError:
~\miniconda3\envs\tf_cpu\lib\json\__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
292 """
--> 293 return loads(fp.read(),
294 cls=cls, object_hook=object_hook,
~\miniconda3\envs\tf_cpu\lib\encodings\cp1252.py in decode(self, input, final)
22 def decode(self, input, final=False):
---> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]
24
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 11976754: character maps to <undefined>
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-5-678a15847c0e> in <module>
----> 1 from ipynb.fs.full.2ndnotebook import *
~\miniconda3\envs\tf_cpu\lib\site-packages\ipynb\fs\full\__init__.py in get_code(self, fullname)
30 except ValueError:
31 # This is when it isn't a valid json file
---> 32 raise ImportError('Could not import {path} for {fn}: not a valid ipynb file'.format(
33 path=self.path,
34 fn=fullname
ImportError: Could not import 2ndnotebook.ipynb for ipynb.fs.full.2ndnotebook: not a valid ipynb file