<DIV>Hi! Bob</DIV> <DIV> </DIV> <DIV>I have not tried to append current directory in sys.path. Maybe I need to do sth </DIV> <DIV>sys.path.append("./") and then do import. The module is installed in MacPython package. The os module is in python23.dylib so it can find it and import it. But my module is just a py file. </DIV> <DIV> </DIV> <DIV>Thanks </DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Zhi<BR><BR><B><I>Bob Ippolito <bob@redivi.com></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>On Dec 9, 2005, at 4:41 PM, Zhi Peng wrote:<BR><BR>> In my c code, I have used myMod=PyImport_ImportModule("moduleName") <BR>> and run on Mac, but it just can not import the "moduleName" for <BR>> some unknown reason.<BR>><BR>> I am sure I install the "moduleName" by "pythonw setup install". <BR>> And I can import "moduleName" from command lines such as<BR>><BR>>
>pythonw<BR>> >import moduleName<BR>> ><BR>><BR>> It is fine. I wonder why PyImport_ImportModule can not import it, <BR>> while it can import module os by using<BR>> PyImport_ImportModule("os")<BR>><BR>> Any suggestion?<BR>><BR><BR>Are you sure it's the same version of Python, and the module is on <BR>sys.path? Check sys.version and sys.path<BR><BR>-bob<BR><BR></BLOCKQUOTE> <DIV><BR></DIV><p>
        
                <hr size=1>Yahoo! Shopping<br>
Find Great Deals on Holiday Gifts at <a href="http://us.rd.yahoo.com/mail_us/footer/shopping/*http://shopping.yahoo.com/;_ylc=X3oDMTE2bzVzaHJtBF9TAzk1OTQ5NjM2BHNlYwNtYWlsdGFnBHNsawNob2xpZGF5LTA1
">Yahoo! Shopping</a>