How to reimport an updated package while in Python Interpreter?

0 votes

I often test my module in the Python Interpreter and when I see an error I quickly update the .py file. But how do I make it reflect on the Interpreter?

May 11 in Python by kartik
• 36,040 points

You can use importlib.reload() for the same.

1 answer to this question.

0 votes


To import an updated package while in Python Interpreter you have two method:


try using reimport: a full featured reload for Python.


It looks like this question was asked/answered prior to the release of reimport, which bills itself as a "full featured reload for Python":

Thank You!!

answered May 11 by Niroj
• 78,520 points

Related Questions In Python

+4 votes
7 answers
+1 vote
1 answer

How to print an error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Aug 23, 2018 in Python by Priyaj
• 57,700 points
0 votes
1 answer

how to exit a python script in an if statement

This works fine for me: while True: ...READ MORE

answered Sep 19, 2018 in Python by bug_seeker
• 15,510 points
0 votes
1 answer

How to correctly return an a dictionary as an output in zappier code using python?

David here, from the Zapier Platform team. ...READ MORE

answered Dec 3, 2018 in Python by charlie_brown
• 7,780 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,568 views
0 votes
0 answers
0 votes
1 answer

How to create a zip archive of a directory in Python?

Hello @kartik, The easiest way is to use shutil.make_archive. ...READ MORE

answered May 11 in Python by Niroj
• 78,520 points
0 votes
1 answer

How to get the latest file in a folder using python?

Hello @kartik,  would suggest using glob.iglob() instead of the glob.glob(), as ...READ MORE

answered May 27 in Python by Niroj
• 78,520 points