How to Import dll inside other directory

logistix logistix at cathoderaymission.net
Fri Apr 18 17:18:18 EDT 2003


> -----Original Message-----
> From: python-list-admin at python.org 
> [mailto:python-list-admin at python.org] On Behalf Of Alan Pong
> Sent: Thursday, April 17, 2003 11:07 PM
> To: python-list at python.org
> 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
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

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