<DIV>Hi! Bob</DIV>  <DIV>&nbsp;</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>&nbsp;</DIV>  <DIV>Thanks </DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>Zhi<BR><BR><B><I>Bob Ippolito &lt;bob@redivi.com&gt;</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>&gt; In my c code, I have used myMod=PyImport_ImportModule("moduleName") <BR>&gt; and run on Mac, but it just can not import the "moduleName" for <BR>&gt; some unknown reason.<BR>&gt;<BR>&gt; I am sure I install the "moduleName" by "pythonw setup install". <BR>&gt; And I can import "moduleName" from command lines such as<BR>&gt;<BR>&gt;
 &gt;pythonw<BR>&gt; &gt;import moduleName<BR>&gt; &gt;<BR>&gt;<BR>&gt; It is fine. I wonder why PyImport_ImportModule can not import it, <BR>&gt; while it can import module os by using<BR>&gt; PyImport_ImportModule("os")<BR>&gt;<BR>&gt; Any suggestion?<BR>&gt;<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>