Tryton ERP MySQL installation - mysql

I'm trying to install Tryton ERP with MySQL as the database. It's not quite clear what you are meant to do.
From the config documentation you simply supply the uri to the database under the [database] section:
[database]
uri = mysql://user:pass#localhost:3306
However running trytond -v -c /home/user/.config/tryton/3.8/tryton.conf does not seem to get it working. When trying to access the 127.0.0.1:8050 where I've got Tryton running, I simply get 127.0.0.1 - - [23/Nov/2015 16:55:10] code 404, message File not found
One would assume, Tryton either installs the database on its own or you need to create yourself somehow but I didn't see any documentation surrounding that.
I've also trying adding a database through the Tryton GUI, it encounters the following error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tryton/gui/window/dbcreate.py", line 65, in server_change
common.refresh_langlist(self.combo_language, host, port)
File "/usr/local/lib/python2.7/dist-packages/tryton/common/common.py", line 253, in refresh_langlist
lang_list = rpc.db_exec(host, port, 'list_lang')
File "/usr/local/lib/python2.7/dist-packages/tryton/rpc.py", line 57, in db_exec
result = getattr(connection.common.db, method)(None, None, *args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 271, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 134, in close
return json.loads(self.data, object_hook=object_hook)
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 505, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 389, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value: line 1 column 2 (char 1)
I've got the prerequisites installed that were listed here and MySQL-python package installed, should there be anything else?

You should create a database on MySQL with it's own tools. Once the database is created you must initialize it using the following command:
trytond -c <config_file> -d <database name> --all
See for complete reference:
http://doc.tryton.org/3.8/trytond/doc/topics/setup_database.html#topics-setup-database.
Once finished, the server will ask for an admin password. Once entered you can conect using the tryton client with the admin user and the entered password.
In order to access tryton from web client you must install and configure the sao web interface, that can be found on:
https://www.npmjs.com/package/tryton-sao

Related

Compress command fails on fresh installation of WireCloud

I cannot set up a basic wirecloud instance anymore. I tried to create a minimum Wirecloud instance like this:
virtualenv venv
source venv/bin/activate
pip install wirecloud
wirecloud-admin startproject prj
cd prj/
python manage.py collectstatic
python manage.py compress --force
Upon the call to compress the static files an error is thrown:
CommandError: An error occurred during rendering /opt/wc/venv/local/lib/python2.7/site-packages/wirecloud/defaulttheme/templates/wirecloud/views/base_plain.html: Error parsing expression at 30:
none if($important, !important)
^
on line 2 of theme/wirecloud.defaulttheme/css/base/z-depth.scss
Traceback:
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/calculator.py", line 167, in parse_expression
ast = getattr(parser, target)()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 110, in goal
expr_lst = self.expr_lst()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 199, in expr_lst
expr_slst = self.expr_slst()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 211, in expr_slst
or_expr = self.or_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 216, in or_expr
and_expr = self.and_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 225, in and_expr
not_expr = self.not_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 236, in not_expr
comparison = self.comparison()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 244, in comparison
a_expr = self.a_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 275, in a_expr
m_expr = self.m_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 290, in m_expr
u_expr = self.u_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 319, in u_expr
atom = self.atom()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 359, in atom
return TernaryOp(expr_lst)
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/ast.py", line 558, in __init__
raise SyntaxError("if() must have exactly 3 arguments")
SyntaxError: if() must have exactly 3 arguments
What is the problem here? I just set up the most basic Wirecloud instance possible. If I do not compress it the same error gets thrown in the browser. Is the latest release of wirecloud broken? Or is it something else?
What do I need to do to get a running version again? Help would be much appreciated since the docker image seems to not be able to get restarted and configurations like other databases and so on are thus not very easy to set up...
Use the just released version 0.9.2 of WireCloud :)
See this github ticket for more details.
We are also updated the docker images but if you continue have problems using it, please create a Github ticket or create a new question on StackOverflow with the details.
Wirecloud seems to not be ready for pyscss version 1.3.5.
A downgrade via ´pip install -I pyscss==1.3.4` will do the trick.

MySQL server has gone away (code 2006)

I sow post on
How to enable MySQL client auto re-connect with MySQLdb?
I had the same problem, I use pythonanywhere.com and when I write p.save() I had error like below.
It says something about updating mysql to fix it, but I don't know what code or shell commands I need to write.
Can you help me?
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
force_update=force_update, update_fields=update_fields)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py", line 570, in save_base
with transaction.commit_on_success_unless_managed(using=using, savepoint=False):
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/transaction.py", line 280, in __enter__
connection.set_autocommit(False)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 340, in set_autocommit
self._set_autocommit(autocommit)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 461, in _set_autocommit
self.connection.autocommit(autocommit)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 461, in _set_autocommit
self.connection.autocommit(autocommit)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 243, in autocommit
_mysql.connection.autocommit(self, on)
OperationalError: (2006, 'MySQL server has gone away')
Your connection to the database was closed because it was idle for too long. From the traceback, it looks like you were doing your queries interactively. If you know that you've been idle for more than about 5 min, you should do this:
from django.db import connection; connection.close()
I solved the problem inserting this code where the connection will need to be restored and refreshed:
try:
cursor = connections['default'].cursor()
db = cursor.db
assert issubclass(db.__class__, BaseDatabaseWrapper)
if db.connection is None or not db.is_usable():
db.close_if_unusable_or_obsolete()
with db.wrap_database_errors:
db.connect()
logger.info('Restoring the Mysql Connection')
except Exception as e:
logger.exception('DB Connection error')
Please notice that I use connections['default'] because I have multiple databases configured so you can set a specific connection, notice also that I use db.is_usable() so to call the .ping() to allow to restore a connection when is possible instead of always closing the connection.

Mercurial https clone: "abort: error: (...) wrong version number"

I have problem with mercurial on OS X 10.9.1
I have a repository on bitbucket with couple files, when I'm trying to clone it I'm getting an error:
mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k#bitbucket.org/kubecz3k/test
abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
I have installed Mercurial 2.8.2 for MacOS X 10.9 from https://www.mercurial-scm.org/downloads/
I'm pretty sure that on the side of the bitbucket everything is ok, because I have no problem on linux machine.
here is the full traceback:
mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k#bitbucket.org/kubecz3k/test --traceback
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 133, in _runcatch
return _dispatch(req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 806, in _dispatch
cmdpats, cmdoptions)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 585, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 897, in _runcommand
return checkargs()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 868, in checkargs
return cmdfunc()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 803, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 512, in check
return func(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/commands.py", line 1286, in clone
branch=opts.get('branch'))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 268, in clone
srcpeer = peer(ui, peeropts, source)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 122, in peer
return _peerorrepo(rui, path, create).peer()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 102, in _peerorrepo
obj = _peerlookup(path).instance(ui, path, create)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 238, in instance
inst._fetchcaps()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 57, in _fetchcaps
self.caps = set(self._call('capabilities').split())
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 171, in _call
fp = self._callstream(cmd, **args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 118, in _callstream
resp = self.urlopener.open(req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/url.py", line 368, in https_open
return self.do_open(self._makeconnection, req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/keepalive.py", line 257, in do_open
raise urllib2.URLError(err)
URLError: <urlopen error [Errno 1] _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number>
abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
My Python version is:
mac-mini-jakub:~ kubeczek$ python -V
Python 2.7.6
And SSL:
>>> print _ssl.OPENSSL_VERSION
OpenSSL 0.9.8y 5 Feb 2013
I will appreciate every help, thanks!
You probably have to disable TLS, read this
To do so, add this to ~/.hgrc
[ui]
tls = False
more information about SSL and TLS here
There is another cause. It might not have been your problem, but it should be listed here as well, for the case others encounter this problem:
If you are behind a proxy and your proxy settings are incorrect, this error message appears as well. God knows why...
Example: you have the following config
[http_proxy]
no = localhost,127.0.0.1
host = 1.2.3.4:8080
user = myusername
passwd = oldpassword
The oldpassword might be obsolet (you have forgotten to change it). Then the very same SSL wrong version error appears. It does absolutly make no sense at all (at least to me), but I reproduced this issue with mercurial 3.6.2. Correcting the proxy settings fixes everything.
Not exactly a direct solution but good workaround:
With strong suggestion that the problem lies is ssl I have switched to ssh(https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678) and now everything works. So from a practical point of view for me this problem is solved.
I had this problem for some bitbucket repositories (but not all). I found that, as per the traceback, setting --config ui.clonebundles=false worked.
hg clone --config ui.clonebundles=false https://bitbucket.org/me/myrepo
made the clone much slower mind you.
[edit] -- Although, see my comment on #UniversE's answer above, the actual problem was to do with an atlassian subdomain not being on my squid proxy's whitelist. phew, that was hard to debug.
As one of the question's comments suggested, switching from https to ssh fixed it for me
You have to disable clonebundle from system wide mercurial config file or own config file.
To do, add following lines to /etc/mercurial/hgrc or ~/.hgrc
# system-wide mercurial configuration file
# See hgrc(5) for more information
[ui]
clonebundles = False

Pyramid, Python3, SQLAlchemy and MySQL

I want Pyramid, Python3, SQLAlchemy and MySQL to play nice on a single machine. This question has been asked before, but it was a long enough time ago that I'm hoping the answer has changed...
Questions:
What driver works for getting a Python 3 Pyramid app to talk nicely to MySQL via SQLAalchemy? Is this even possible?
I've gotten quite far in this project thinking it would be a simple thing to switch out databases, now I'm a bit stuck and downgrading to Python 2.7 is not something I want to have to go through. So my second question is:
If there is no way to talk to MySQL nicely without downgrading, is there a database that Python 3 is ready for (besides SQLite)?
Or lastly, how would I overcome any of the problems mentioned in the 'Stuff I've Tried' section below?
Stuff I've Tried:
PyMySQL
I have PyMySQL installed and I even got it to complain about incorrect passwords and a missing database so it's getting something right. But when I tried to initialize my database (using initialize_foo_db) everything went sour:
2013-02-06 17:18:31,282 INFO [sqlalchemy.engine.base.Engine][MainThread] b'SELECT DATABASE()'
2013-02-06 17:18:31,282 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
Traceback (most recent call last):
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 719, in _do_get
return self._pool.get(wait, self._timeout)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/util/queue.py", line 137, in get
raise Empty
sqlalchemy.util.queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../bin/initialize_mega_db", line 9, in <module>
load_entry_point('mega==0.0', 'console_scripts', 'initialize_mega_db')()
File "/home/sheena/MegaCatalogue/env/mega/mega/scripts/initializedb.py", line 46, in main
Base.metadata.create_all(engine)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/schema.py", line 2567, in create_all
tables=tables)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 2301, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 2492, in contextual_connect
self.pool.connect(),
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 224, in connect
return _ConnectionFairy(self).checkout()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 387, in __init__
rec = self._connection_record = pool._do_get()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 741, in _do_get
con = self._create_connection()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 188, in _create_connection
return _ConnectionRecord(self)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 273, in __init__
pool.dispatch.first_connect.exec_once(self.connection, self)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/event.py", line 279, in exec_once
self(*args, **kw)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/event.py", line 288, in __call__
fn(*args, **kw)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/strategies.py", line 168, in first_connect
dialect.initialize(c)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/dialects/mysql/base.py", line 1999, in initialize
default.DefaultDialect.initialize(self, connection)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/default.py", line 177, in initialize
self._get_default_schema_name(connection)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/dialects/mysql/base.py", line 1964, in _get_default_schema_name
return connection.execute('SELECT DATABASE()').scalar()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1628, in _execute_text
statement, parameters
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1691, in _execute_context
context)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/default.py", line 333, in do_execute
cursor.execute(statement, parameters)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/PyMySQL3-0.5-py3.2.egg/pymysql/cursors.py", line 108, in execute
query = query % escaped_args
TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
oursql
I tried installing oursql using pip install -r file
where file contains:
#oursql==0.9.3 but need special Python 3 build https://bugs.launchpad.net/oursql/+bug/1051512
https://launchpad.net/oursql/py3k/py3k-0.9.3/+download/oursql-0.9.3.zip
pyramid==1.3.4
And I got:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
myconnpy
This installs without error but I can't seem to find out what I should tell SQLAlchemy to look for. In the appropriate settings.ini file I have tried:
sqlalchemy.url = mysql+myconnpy://...
as well as a bunch of other things. Google is failing me on this one...
UPDATE - a semblance of progress
I've managed to install oursql build dependencies:
sudo aptitude install python-pip libmysqlclient-dev
I then downloaded oursql0.9.3 and ran:
setup.py install
The output was this:
cython not found, using previously-cython'd .c file.
running install
running build
running build_ext
running install_lib
copying build/lib.linux-x86_64-3.2/oursql.cpython-32mu.so -> /home/sheena/MegaCatalogue/env/lib/python3.2/site-packages
running install_egg_info
Writing /path/to/virtualenv/foo/lib/python3.2/site-packages/oursql-0.9.3.egg-info
I opened a shell and apparently the module doesn't exist - it can't be imported anyway. But for some reason it is listed if I say help() then modules

SQLAlchemy mysql dialect error with py2app

I'm having trouble getting SQLAlchemy to work with my compiled app after getting through py2app. I've done this successfully in Windows with py2exe. The following is my setup file:
APP = ['Blah.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True,
'includes': ['sip',
'PyQt4._qt',
'sqlalchemy.dialects.mysql',
'MySQLdb',
"gzip"]
}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
This appears like it's the right way to do it, as I've seen people use it for sqlite, however I still get this error upon trying to run the app after compile:
sqlalchemy.exc.ArgumentError: Could not determine dialect for 'mysql+mysqldb'
I've recently been trying with PyInstaller and have gotten stuck at pretty much the same spot, albeit with a different error which is the following:
Traceback (most recent call last):
File "<string>", line 96, in <module>
File "/Users/tom/Downloads/pyinstaller-pyinstaller-2145d84/PyInstaller/loader/iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "/Users/tom/Downloads/pyinstaller-pyinstaller-2145d84/PyInstaller/loader/iu.py", line 480, in doimport
exec co in mod.__dict__
File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line 19, in <module>
File "/Users/tom/Downloads/pyinstaller-pyinstaller-2145d84/PyInstaller/loader/iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "/Users/tom/Downloads/pyinstaller-pyinstaller-2145d84/PyInstaller/loader/iu.py", line 480, in doimport
exec co in mod.__dict__
File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 4, in __bootstrap__
File "OSX_Installer/Jango/build/pyi.darwin/Jango/out00-PYZ.pyz/pkg_resources", line 882, in resource_filename
File "OSX_Installer/Jango/build/pyi.darwin/Jango/out00-PYZ.pyz/pkg_resources", line 1352, in get_resource_filename
File "OSX_Installer/Jango/build/pyi.darwin/Jango/out00-PYZ.pyz/pkg_resources", line 1363, in _extract_resource
KeyError: '_mysql/_mysql.so'
you probably also need _mysql which should include the native mysql bindings. also, this bindings need the binary mysql libraries to be installed on the target system.
your application would probably be a lot more portable if you used a pure python mysql library, such as pymysql or MySQL Connector/Python (both are supported by sqlalchemy)