xeus-python icon indicating copy to clipboard operation
xeus-python copied to clipboard

Import ipynb file with xeus-python as jupyterlab kernel

Open brandon-68 opened this issue 4 years ago • 5 comments

Hi,

I am using xeus-python as the kernel in python3.6 in jupyterlab 3.0.

When I key in the following command, "from ipynb.fs.full.performance_measurement import performance_analysis as pa", I get the below error.

Any idea on how to solve it?

KeyError Traceback (most recent call last) File C:\Users\User\anaconda3\envs\env_testing\lib\site-packages\IPython\core\interactiveshell.py, in run_code: Line 3437: exec(code_obj, self.user_global_ns, self.user_ns)

In [3]: Line 1: from ipynb.fs.full.performance_measurement import performance_analysis as pa

File C:\Users\User\anaconda3\envs\env_testing\lib\site-packages\ipynb\fs_init_.py, in : Line 27: if ip.user_ns['package'] is None:

KeyError: 'package'

brandon-68 avatar Apr 25 '21 05:04 brandon-68

Did you try the latest xeus-python? It makes use of IPython and user_ns should be better populated.

martinRenou avatar Apr 26 '21 07:04 martinRenou

image

These are the package versions that i have installed. Are they the latest?

brandon-68 avatar Apr 26 '21 23:04 brandon-68

No, xeus-python 0.12.3 is the latest.

martinRenou avatar Apr 27 '21 07:04 martinRenou

i updated the package to the following version and still face the same issue. I am using Python v3.8. Any idea on how to fix this issue will be greatly appreciated.

  1. Package Version image

  2. Error Message File C:\Users\Name\anaconda3\envs\env_name\lib\site-packages\ipynb\fs_init_.py, in : Line 27: if ip.user_ns['package'] is None: KeyError: 'package'

brandon-68 avatar May 09 '21 08:05 brandon-68

I tried with python 3.9 with xeus-python and same error, shown below, appears.

I think xeus-python doesn't work with commands that import other jupyter files via "from ipynb......" command

File C:\Users\Name\anaconda3\envs\env_name\lib\site-packages\ipynb\fs_init_.py, in : Line 27: if ip.user_ns['package'] is None: KeyError: 'package'

brandon-68 avatar May 15 '21 06:05 brandon-68