简体   繁体   中英

In Jupyter Notebook NameError when I try to import a module

I have 2 modules written in Jupyter Notebook (windows OS). I try to import module_1.py into module_2.py like that:

import module_2
...

I have error: NameError Traceback (most recent call last) in () 1 from tkinter import * 2 ----> 3 import Backend 4 5 def view_command():

C:\python\GUI\Backend.py in <module>()
     72   {
     73    "cell_type": "code",
---> 74    "execution_count": null,
     75    "metadata": {},
     76    "outputs": [],

NameError: name 'null' is not defined

Maybe it is because of in IPython importing is not as simple as in Python. Thanks for help

Python uses None for null objects. Try to change the null on line 74 to None and import again and it should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM