NameError: name 'reload' is not defined

前端 未结 4 1313
忘了有多久
忘了有多久 2020-12-08 18:22

I\'m using python 3.2.2. When I write a simple program, I meet the problem.

>>> reload(recommendations)
Traceback (most recent call last):
  File \"         


        
4条回答
  •  抹茶落季
    2020-12-08 18:45

    An update to @Gareth Latty's answer. imp was depreciated in Python 3.4. Now you want importlib.reload().

    from importlib import reload
    

提交回复
热议问题