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


Groups > comp.lang.python > #8813

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:module': 0.04; 'importerror:': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'statement.': 0.09; 'subject:don': 0.09; '"import"': 0.16; 'imp': 0.16; 'stephane': 0.16; 'subject:import': 0.16; '>>>': 0.16; '(most': 0.21; 'blog:': 0.22; 'traceback': 0.25; 'import': 0.29; 'module': 0.30; 'hi,': 0.31; 'named': 0.32; 'to:addr:python-list': 0.34; 'header:X-Complaints- To:1': 0.34; 'header:User-Agent:1': 0.34; "can't": 0.34; 'last):': 0.35; 'module.': 0.35; 'subject: ?': 0.35; 'here,': 0.35; 'install': 0.36; 'skip:" 10': 0.36; 'file': 0.36; 'some': 0.37; 'but': 0.37; 'received:org': 0.38; 'subject:can': 0.38; 'header :Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'subject:but': 0.67; 'subject:this': 0.74; 'url:info': 0.75; 'from:charset:windows-1252': 0.84; 'subject:found': 0.91; 'klein': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Stéphane Klein <stephane@harobed.org>
Subject imp.find_module don't found my module but standard import statement can import this module… why ?
Date Tue, 05 Jul 2011 09:36:59 +0200
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host pda57-1-82-231-115-1.fbx.proxad.net
User-Agent Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110627 Thunderbird/5.0
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.622.1309851435.1164.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1309851435 news.xs4all.nl 21753 [2001:888:2000:d::a6]:40980
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8813

Show key headers only | View raw


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 <stephane@harobed.org>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com

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


Thread

imp.find_module don't found my module but standard import statement can import this module… why ? Stéphane Klein <stephane@harobed.org> - 2011-07-05 09:36 +0200

csiph-web