Why do I get “UserWarning: Module dap was already imported from None …”

前端 未结 3 2161
挽巷
挽巷 2021-02-19 19:14

I have python-matplotlib and python-mpltoolkits.basemap installed from Ubuntu packages. Installing python-mpltoolkits.basemap also install

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-19 19:19

    If you don't need the package, simply remove it, e.g. on an Ubuntu or Debian system apt-get remove --purge python-dap removed the package for me and that silenced the warning. It is easy to accidentally install packages that you don't need because of dependency recommendations when installing some packages.

    When you try to remove it the packaging system will warn you if removal of the package (in this case python-dap, but other packages could cause this error to happen, too) would also force removal of other packages which depend on it. In my case there are no other packages that directly depended on python-dap and I wasn't using it for anything that I was aware of, so uninstalling it was simple, painless, and silenced the warning.

    Other package installers (such as the non-OS packaging systems like pip or easy_install) might make it more difficult to remove the package; you may need to delete the package by hand, so I'd instead recommend the accepted answer as the way to silence the warning unless the apt-get remove method I recommended here works for you.

提交回复
热议问题