我已经安装python-matplotlib
了python-mpltoolkits.basemap
Ubuntu 软件包。安装python-mpltoolkits.basemap
也会python-dap
作为依赖项安装。
当我导入底图时,我收到以下警告:
>>> 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__)
这是否意味着我有 2 个相互冲突的安装dap
?(这可能是一些旧手动安装的残余。)这是一个有点类似的警告消息,但在他的情况下,该消息告诉另一个冲突安装的位置。我的消息只是说None
。这是什么意思?
编辑1:
>>> import sys
>>> print sys.modules['dap']
<module 'dap' (built-in)>
编辑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'
编辑3:是的,我似乎有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()
编辑4:实际上我可以通过以下方式得到错误:
>>> 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
所以这与此无关mpl_toolkits.basemap
。