Minor gripe about module names

Chris Angelico rosuav at gmail.com
Sat May 12 06:51:23 EDT 2012


On Sat, May 12, 2012 at 8:41 PM, John O'Hagan <research at johnohagan.com> wrote:
> Not sure if this is only package-manager specific, but occasionally I come
> across a module that sounds interesting, install it (in my case by apt-get),
> and then can't find it, because the actual module has a different name from
> what it says on the package - unlike the majority, which if they are called
> "python-whatever", are imported using "import whatever".

You import based on the filename, so all you need is the list of files
from the package:

$ dpkg -L python-ecasound

This works only after the package has been installed successfully. Not
a solution to your problem, but possibly a viable workaround.

ChrisA



More information about the Python-list mailing list