NameError: name ‘reload‘ is not defined

Today, I found a small error in a machine learning example. The reason is that python2 comes with the reload module, and python3 needs to import the imp library to use the reload module. The specific situation is shown in the following figure: The
Insert picture description here
solution is shown in the figure. I am writing here. After from imp import *importing the reload module first, use the reload module to call my knn file, ie reload(knn).

In fact, I am also one of the people who entered the pit. Therefore, the solution must be attributed to the article of the big guy, everyone can go and read the link address . I hope my article can help you solve the problem, and I wish you success!

Finally, thank you all for coming to watch my article. There may be many improprieties in the article, and I hope to point out He Haihan.

Guess you like

Origin blog.csdn.net/weixin_43408020/article/details/113838312
Recommended