Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #105 (closed defect: fixed)

Opened 14 years ago

Last modified 12 years ago

Documentation needs to reflect database driver installation

Reported by: poeticsoftware@… Owned by: SuperJared
Priority: normal Milestone: 0.9
Component: Documentation Version: 0.8
Severity: normal Keywords: mysql module mysqldb
Cc:

Description (last modified by kevin) (diff)

The documentation right now does not reflect database driver installation at all. This has tripped up more than a few users, and some hints here would be beneficial. The original report (below) is an example... it appears that the Python DBAPI database driver is just not installed.


Could this be because I have the new MySQL version 5 on my OSX 10.4? Is SQLObject not yet compatible with MYSQL 5 ? Exception trace follows:

eric-hawthornes-ibook-g4:~/Desktop/devel/vote/ballots eric$ tg-admin sql create Using database URI mysql://webapp:notrealpw@localhost:3306/ballots Traceback (most recent call last):

File "/usr/local/bin/tg-admin", line 7, in ?

sys.exit(

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.8a4-py2.4.egg/turbogears/command/init.py", line 186, in main

command.run()

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.8a4-py2.4.egg/turbogears/command/init.py", line 106, in run

command.the_runner.run(sys.argv)

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/manager/command.py", line 102, in run

runner.run()

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/manager/command.py", line 233, in run

self.command()

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/manager/command.py", line 543, in command

for soClass in self.classes(require_some=True):

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/manager/command.py", line 245, in classes

all.extend(self.classes_from_egg(egg_spec))

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/manager/command.py", line 410, in classes_from_egg

modules.extend(self.classes_from_module(

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/util/moduleloader.py", line 5, in load_module

mod = import(module_name)

File "/Users/eric/Desktop/devel/vote/ballots/ballots/model.py", line 13, in ?

class Election(ElectionDivision?):

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/declarative.py", line 94, in new

cls.classinit(cls, new_attrs)

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 744, in classinit

if not connection and not getattr(cls, '_connection', None):

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.8a4-py2.4.egg/turbogears/database.py", line 99, in get

return self.hub.get(obj, type)

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", line 848, in get

return self.getConnection()

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.8a4-py2.4.egg/turbogears/database.py", line 25, in getConnection

conn = sqlobject.connectionForURI(self.uri)

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", line 913, in connectionForURI

conn = self.schemeBuilders[scheme]().connectionFromURI(uri)

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 35, in connectionFromURI

host=host or 'localhost', port=port or 0, args)

File "/Library/Frameworks/Python?.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 14, in init

import MySQLdb

ImportError?: No module named MySQLdb

Change History

comment:1 Changed 14 years ago by kevin

  • Severity changed from blocker to normal
  • Summary changed from MySQLdb module not found in tg-admin sql command execution to Documentation needs to reflect database driver installation
  • Component changed from SQLObject to Docs
  • Description modified (diff)
  • Milestone set to 0.9

comment:2 Changed 14 years ago by poeticsoftware@…

Finally got it to go: Maybe you could include this sql driver installation tip in the doc: For the MySQL on Mac OsX 10.4 I eventually googled to  http://pythonmac.org/packages/MySQL_python-1.2.0-py2.4-macosx10.3.zip which contains a mac package (installer program) that installs a binary of the mysqldb module (installs it in the proper python 2.4 external libs directory.) Seems to work fine in macosx10.4 w. mysql 5.0.

Had a lot of false starts though. Googling, most people in discussion groups were suggesting I had to compile the MySQL_python (mysqldb) module from source (from sourceforge project.) However this did NOT go anywhere near cleanly (starting from just an out-of-box macosx 10.4.2 state.) Eventually I gave up. Some of the problems, for entertainment value: The python setup.py build command invokes cpp to compile the module. There is no cpp. Spotlight suggests an installer called cpp4.0.pkg. Install that (praying that 4.0 compiler will work on that source). Reboot. Still no cpp! Using ancient wisdom, discover that there is now a /usr/bin/cpp-4.0.0 Utter magic incantation sudo ln -s cpp-4.0.0 cpp Try the python setup script again. There is a cpp! Rejoice! But wait... There is no limits.h file found (included from Python.h in the python 2.4 distribution). Apparently the mac xcode version of cpp is not finding the directory /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/include which has the basic system standard header files like limits.h, stdio.h etc. Try modifying the setup.py script in mysql_python_1.2 dir to add the argument

-I /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/include to the cpp command.

No dice. Give up. Hunt for precompiled binary. Yeehah!

The point being that a non-geek (or a "casual" python programmer with little c or unix experience) would not stand a chance without a few really specific documentation pointers, or better yet, some scripts that work on the mac platform.

comment:3 Changed 14 years ago by SuperJared <jared.kuolt@…>

  • Owner changed from anonymous to SuperJared

comment:4 Changed 14 years ago by SuperJared <jared.kuolt@…>

  • Status changed from new to closed
  • Resolution set to fixed

Diffs sent to kevin.

Note: See TracTickets for help on using tickets.