I have python-matplotlib
and python-mpltoolkits.basemap
installed from Ubuntu packages. Installing python-mpltoolkits.basemap
also installs python-dap
as a dependency.
When I import basemap, I get this warning:
>>> import mpl_toolkits.basemap
/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py:2: UserWarning: Module dap was
already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path
__import__('pkg_resources').declare_namespace(__name__)
What does this mean?
EDIT 1:
>>> import sys
>>> print sys.modules['dap']
<module 'dap' (built-in)>
EDIT 2:
$ python -S
Python 2.7.3 (default, Sep 26 2012, 21:53:58)
[GCC 4.7.2] on linux2
>>> import sys
>>> print sys.modules['dap']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'dap'
EDIT 3: yes I seem to have sitecustomize.py
:
$ cat /etc/python2.7/sitecustomize.py
# install the apport exception handler if available
try:
import apport_python_hook
except ImportError:
pass
else:
apport_python_hook.install()
EDIT 4: actually I can get the error by:
>>> import pkg_resources
__main__:1: UserWarning: Module dap was already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path
so this has nothing to do with mpl_toolkits.basemap
as such.
sys.modules['dap']
that does not have a path. It's a warning, btw, not an exception, so it may be okay. What doesprint sys.modules['dap']
give you? – Overreact(built-in)
. Interesting, I wonder what poked that in there. Did you import anything or is that a clean python interpreter? Or did youimport mpl_toolkits.basemap
first? – Overreactimport mpl_toolkits.basemap
first or not, the result is the same. – Caneghemsitecustomize.py
orusercustomize.py
module somewhere that fiddles something. Try runningpython -S
(disablesite.py
) and testsys.modules['dap']
again. – Overreact