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


Groups > comp.lang.python > #7313

Re: Import error while running python application on Mac OS

From Ned Deily <nad@acm.org>
Subject Re: Import error while running python application on Mac OS
Date 2011-06-09 12:34 -0700
References <ce14c481-f180-48fc-b38a-57d139a357f8@e17g2000prj.googlegroups.com> <1167f414-8901-4f9c-9d51-2723213fd036@k3g2000prl.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.59.1307648104.11593.python-list@python.org> (permalink)

Show all headers | View raw


In article 
<1167f414-8901-4f9c-9d51-2723213fd036@k3g2000prl.googlegroups.com>,
 hisan <santosh.ssit@gmail.com> wrote:

> On Jun 8, 9:20 pm, hisan <santosh.s...@gmail.com> wrote:
> > I have created an application for Mac OS using py2app module, in my
> > python script i have external modules such as MySQLdb and other ,
> > while trying to run on Mac OS i get an error saying unable to import
> > the module MySQLdb.
> > On Windows i convert python script to an exe using py2exe module and
> > if i install VC++ on y machine my exe runs fine.
> > Is there any dependency on MAC OS.
> Can Some one reply for this Please

You will want to ask questions about Python on Mac OS X on the Pythonmac 
list.

http://dir.gmane.org/gmane.comp.python.apple

But you need to supply more information.  There are many reasons why you 
might get an import error.  You should supply the exact traceback from 
the failing import and say which Python instance you are using, which 
version of MySQLdb, which set of MySQL client libraries - all of which 
need to be built compatibly (i.e. compatible CPU archs and deployment 
targets) and packaged in the app bundle or installed externally on the 
end user's machine.  You need to specify what version of OS X you are 
using and what range of OS X versions your app is targeted for.  And you 
should say whether everything works without trying to use py2app.  
Getting a working combination of python, MySQLdb, and MySQL client libs 
on OS X can be frustrating if you try to guess at it or use binaries 
from different suppliers.  If possible, use a complete solution from a 
3rd-party open source packager, like MacPorts or Homebrew.

-- 
 Ned Deily,
 nad@acm.org

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


Thread

Import error while running python application on Mac OS hisan <santosh.ssit@gmail.com> - 2011-06-08 09:20 -0700
  Re: Import error while running python application on Mac OS hisan <santosh.ssit@gmail.com> - 2011-06-09 10:16 -0700
    Re: Import error while running python application on Mac OS Ned Deily <nad@acm.org> - 2011-06-09 12:34 -0700

csiph-web