imp.find_module don't found my module but standard import statement can import this module… why ?

Discussion in 'Python' started by Stéphane Klein, Jul 5, 2011.

  1. Hi,

    I would like import some module dynamically.

    First, I install "js.jquery"

    $ pip install js.jquery

    Here, I would like import "js" module.

    >>> import imp
    >>> imp.find_module("js")

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named js
    >>> import js
    >>>


    I can't found module with "imp.find_module" but I can import it with
    standard "import" statement.

    Where is my mistake ?

    Regards,
    Stephane
    --
    Stéphane Klein <>
    blog: http://stephane-klein.info
    Twitter: http://twitter.com/klein_stephane
    pro: http://www.is-webdesign.com
     
    Stéphane Klein, Jul 5, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    2
    Views:
    311
    Nick Coghlan
    Dec 19, 2004
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,009
    Smokey Grindel
    Dec 2, 2006
  3. Emanuele D'Arrigo

    import vs imp and friends.

    Emanuele D'Arrigo, Jul 23, 2009, in forum: Python
    Replies:
    2
    Views:
    254
    Emanuele D'Arrigo
    Jul 24, 2009
  4. Peng Yu
    Replies:
    0
    Views:
    328
    Peng Yu
    Oct 31, 2009
  5. MRAB
    Replies:
    0
    Views:
    418
Loading...

Share This Page