How to Import dll inside other directory

logistix logistix at
Fri Apr 18 23:18:18 CEST 2003

> -----Original Message-----
> From: python-list-admin at 
> [mailto:python-list-admin at] On Behalf Of Alan Pong
> Sent: Thursday, April 17, 2003 11:07 PM
> To: python-list at
> Subject: How to Import dll inside other directory
> a C extension dll (myext1.dll) compiled by vc++ and placed in c:\
> run python 2.3.exe under c:\ in dos prompt, 
> >>from myext1 import *
> ok
> then, move the dll to c:\temp, run python 2.3.exe again under c:\,
> >>from temp.myext1 import * (according to the help doc.)
> error:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named temp.myext1
> Does anybody know how to import dll inside other directory? 
> Thanks. Rgds. Alan
> -- 

The directory needs to be in pythonpath for it to be found.  Use "import
sys;print sys.pythonpath" to see what this is.  Assuming "C:\temp" is in
your pythonpath, you'd still only "import myext" not "import temp.myext"

More information about the Python-list mailing list