Jan-29-2021, 05:20 PM
(This post was last modified: Jan-29-2021, 05:22 PM by Gribouillis.)
There is a strange behavior of Python on my machine:
Worse, if I import
Can someone give me a clue about this? I'm puzzled
~/P/S/2021-01 python3.8 Python 3.8.7 (default, Dec 21 2020, 21:23:03) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.modules['mpl_toolkits'] <module 'mpl_toolkits' (namespace)> >>> import pkg_resources >>> sys.modules['mpl_toolkits'] <module 'mpl_toolkits' from '/usr/lib/python3/dist-packages/mpl_toolkits/__init__.py'>When I start Python 3.8, there is already an
'mpl_toolkits'
entry in sys.modules
, but this module is related to matplotlib, so how comes it appears in sys.modules without any attempt to use matplotlib?Worse, if I import
pkg_resources
, which is not related to matplotlib, this time the mpl_toolkits module is loaded from the dist-packages directory.Can someone give me a clue about this? I'm puzzled
