Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26657

find out whether a module exists (without importing it)

From Gelonida N <gelonida@gmail.com>
Subject find out whether a module exists (without importing it)
Date 2012-08-06 22:48 +0200
Newsgroups comp.lang.python
Message-ID <mailman.3030.1344286110.4697.python-list@python.org> (permalink)

Show all headers | View raw


Is this possible.

let's say I'd like to know whether I could import the module
'mypackage.mymodule', meaning,
whther this module is located somewhere in sys.path

i tried to use

imp.find_module(), but
it didn't find any module name containing a '.'

Am I doing anything wrong?

Is there another existing implementation, that helps.

I could do this manually, but this is something I'd just like to do if 
necessary.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

find out whether a module exists (without importing it) Gelonida N <gelonida@gmail.com> - 2012-08-06 22:48 +0200
  Re: find out whether a module exists (without importing it) Miki Tebeka <miki.tebeka@gmail.com> - 2012-08-06 14:58 -0700
  Re: find out whether a module exists (without importing it) Miki Tebeka <miki.tebeka@gmail.com> - 2012-08-06 14:58 -0700
    Re: find out whether a module exists (without importing it) Gelonida N <gelonida@gmail.com> - 2012-08-07 00:40 +0200

csiph-web