Unloading a module in Python 3.x

Quora Feans

It's clear to me that there was no clean solution in Python 2 to unload a module, and this was a known bug, that was set to be corrected.

The posts:

How do I unload (reload) a Python module? Remove an imported python module

of the year 2009 and 2010 confirm this lack of support for unloading a module.

I wonder if this was solved in Python 3.x. When I do, import os, del os, dir(), the os module is not there (at least not visible, usable). Is it gone?

Keith

The sys.modules does still hold a reference to the module.

>>> import six
>>> del six
>>> sys.modules["six"]
<module 'six' from '/usr/lib64/python3.3/site-packages/six.py'>

sys.modules still holds a reference. So I don't think you can unload a module in Python 3.3 either.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unloading a module in Python 3.x

From Dev

Tor's stem module (python) loading but not unloading config

From Dev

safe unloading of kernel module

From Dev

GWT Module is unloading randomly

From Dev

Linux kernel module hangs during unloading

From Java

python 3.x ImportError: No module named 'cStringIO'

From Dev

How to parse Python 2.x with Python 3.x ast module?

From Dev

Can't import turtle module in Python 2.x and Python 3.x

From Dev

Unloading from redshift to s3 with headers

From Dev

CAN module python 3

From Dev

python 3: import module

From Dev

What happens to memory that wasn't freed in a kernel module after unloading?

From Dev

what kind of table widget module i should use for python 3x

From Dev

TypeError: "'numpy.float64' object is not iterable" using python 3.x possibly os module issue?

From Dev

Python 3 - ImportError: No module named

From Dev

Module dependency graph in Python 3

From Dev

Utilizing collections module in Python 3

From Dev

Module dependency graph in Python 3

From Dev

Python 3 module import error

From Dev

Import module in python3

From Dev

python 3 no module named _tkinter

From Dev

Ansible + Ubuntu 18.04 + MySQL = "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required."

From Dev

adding 'PyLit' pure python module on OS X

From Dev

Python 3: module in same directory as script: "ImportError: No module named"

From Dev

Why does Python 3 statistics module have the collections module as submodule?

From Dev

weird python3 import issue, No module named <module>

From Dev

Why does Python 3 statistics module have the collections module as submodule?

From Dev

Unloading AppDomains

From Dev

Unloading AppDomain

Related Related

HotTag

Archive