Manipulating sys.modules isn’t something you normally have to think about. That is where any module that has been previously imported is stored, so you add modules and packages to it just by importing them.
It might help to think about it this way:
import pandas as pd
print("Pandas imported!")
import pandas as pd
print("Pandas imported again!")
In this example, the first time you import pandas Python is going to look in the sys.modules cache, and not find it (assuming this is the only script that is running). It then looks in the built in modules, and then will look in sys.path for the location of pandas. When you try to import it a second time, Python is able to find it in sys.modules, so it doesn’t need to continue searching or load it again.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4