tg 0.9 on macosx

0 views
Skip to first unread message

Michael Weiner

unread,
Mar 1, 2006, 3:01:19 PM3/1/06
to turbo...@googlegroups.com
I am working my way through the turtorial, trying to educate myself a little bit here at home before i go and munge up my development environment at work. In that process, i grabbed the ez_install.py and got the latest tg et al eggs installed on this Mac OSX 10.4.4 machine running python 2.4.1. Working through the wiki tutorial, i am having a slight problem when i go to create the database/tables using tg-admin sql create, i receive the following errors:

$tg-admin sql create
Using database URI sqlite:///Users/hunter/turbogears/Wiki20/wikidata.db
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.9a1-py2.4.egg/turbogears/command/base.py", line 270, in main
    command.run()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a1-py2.4.egg/turbogears/command/base.py", line 129, in run
    command.the_runner.run(sys.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-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.1dev_r1588-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.1dev_r1588-py2.4.egg/sqlobject/manager/command.py", line 542, 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.1dev_r1588-py2.4.egg/sqlobject/manager/command.py", line 255, in classes
    conn = self.connection()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/manager/command.py", line 316, in connection
    return sqlobject.connectionForURI(self.options.connection_uri)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/dbconnection.py", line 946, in connectionForURI
    conn = self.schemeBuilders[scheme]().connectionFromURI(uri)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/sqlite/sqliteconnection.py ", line 87, in connectionFromURI
    return cls(filename=path, **args)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/sqlite/sqliteconnection.py ", line 23, in __init__
    import sqlite
ImportError: No module named sqlite

And i am basically stuck there. I grabbed pysqlite-2.1.3.tar.gz and installed that thinking that would give me python hooks into sqlite and also installed SQLite 2.8.16 and i am still recieving the same error. Not being a python developer, i am a systems administrator/designer, i may be missing something here, but everything seems to be in place. Am i missing something?

Any assistance would be GREATLY appreciated.

Thanks in advance
Michael Weiner

Ronald Jaramillo

unread,
Mar 1, 2006, 3:13:43 PM3/1/06
to turbo...@googlegroups.com
Hi Michael,
If you open terminal and start Python 2.4 does the following works?

>>> from pysqlite2 import test
>>> test.test()

Cheers
Ronald

unread,
Mar 1, 2006, 3:26:13 PM3/1/06
to turbo...@googlegroups.com
On 3/1/06 3:13 PM, "Ronald Jaramillo" <ron...@checkandshare.com> wrote:

Hi Michael,
If you open terminal and start Python 2.4 does the following works?

>>> from pysqlite2 import test
>>> test.test()

Cheers
Ronald

On Mar 1, 2006, at 9:01 PM, Michael Weiner wrote:

I am working my way through the turtorial, trying to educate myself a little bit here at home before i go and munge up my development environment at work. In that process, i grabbed the ez_install.py and got the latest tg et al eggs installed on this Mac OSX 10.4.4 machine running python 2.4.1. Working through the wiki tutorial, i am having a slight problem when i go to create the database/tables using tg-admin sql create, i receive the following errors:

$tg-admin sql create
Using database URI sqlite:///Users/hunter/turbogears/Wiki20/wikidata.db
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.9a1-py2.4.egg/
<snip>

  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/sqlite/sqliteconnection.py ", line 23, in __init__
    import sqlite
ImportError: No module named sqlite

And i am basically stuck there. I grabbed pysqlite-2.1.3.tar.gz and installed that thinking that would give me python hooks into sqlite and also installed SQLite 2.8.16 and i am still recieving the same error. Not being a python developer, i am a systems administrator/designer, i may be missing something here, but everything seems to be in place. Am i missing something?

Any assistance would be GREATLY appreciated.

Thanks in advance
Michael Weiner
--

Ronald -

Thanks for the reply, i recieve the following  :(

$python
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pysqlite2 import test

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/test/__init__.py", line 25, in ?
  File "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/test/dbapi.py", line 26, in ?
  File "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/dbapi2.py", line 32, in ?
  File "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/_sqlite.py", line 7, in ?
  File "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/_sqlite.py", line 6, in __bootstrap__
ImportError: Failure linking new module: /Users/hunter/.python-eggs/pysqlite-2.1.3-py2.4-macosx-10.4-ppc.egg-tmp/pysqlite2/_sqlite.so: Symbol not found: _sqlite3_transfer_bindings
  Referenced from: /Users/hunter/.python-eggs/pysqlite-2.1.3-py2.4-macosx-10.4-ppc.egg-tmp/pysqlite2/_sqlite.so
  Expected in: dynamic lookup

Ronald Jaramillo

unread,
Mar 1, 2006, 3:38:36 PM3/1/06
to turbo...@googlegroups.com
Hi Michael,
It looks like something is fishy with your pysqlite egg...
I don't know what that can be, but in the meantime if you have the Mac OSX development tools installed you can follow this instructions to get pysqlite running:
Cheers.
Ronald

Bob Ippolito

unread,
Mar 1, 2006, 4:00:06 PM3/1/06
to turbo...@googlegroups.com
That error means that the pysqlite extension wasn't linked to pysqlite for some reason.  Whoever is responsible for that setup.py screwed something up.

Isn't there a binary egg somewhere that has sqlite linked in statically?

-bob

Michael Weiner

unread,
Mar 1, 2006, 4:06:47 PM3/1/06
to turbo...@googlegroups.com
Haahaa, thats what i was actually JUST looking for Bob, thanks.

Michael Weiner
--

unread,
Mar 1, 2006, 4:13:12 PM3/1/06
to turbo...@googlegroups.com
OK, i grabbed, built, and installed sqlite-3.3.4 and then grabbed, built, and installed pysqlite-2.1.3, and now the import works correctly and the test succeeds. Kevin suggested the later version of sqlite above the version Apple bundles with Tiger.

Thanks to all, i am sure i will have more questions as i get deeper into this  :)

Michael Weiner
--

Michael Weiner

unread,
Mar 1, 2006, 4:40:46 PM3/1/06
to turbo...@googlegroups.com
Hopefully, one of my last annoyances to the list, please excuse. But i am trying to hit the wiki in my browser and i am recieving the following:

File "/Users/hunter/turbogears/wiki20/wiki20/templates/master.py", line 80, in _match_func

NameError: name 'turbogearsflash' is not defined

i see that defined in the master.kid, but my question is how to best correct this problem?
Michael Weiner
--

Karl Guertin

unread,
Mar 1, 2006, 4:53:15 PM3/1/06
to turbo...@googlegroups.com
On 3/1/06, Michael Weiner <hun...@userfriendly.net> wrote:
> NameError: name 'turbogearsflash' is not defined
>
> i see that defined in the master.kid, but my question is how to best correct
> this problem?

The variable has been renamed to 'tg_flash'. I have a corrected
wiki20.tgz for 0.9 on my personal site[1].

[1] http://gr.ayre.st/~grayrest/wiki20.tgz

unread,
Mar 1, 2006, 5:06:28 PM3/1/06
to turbo...@googlegroups.com

Karl -

Thank you very much that did the trick, although now i am up against the
AJAX issue reported earlier by another poster, where i click on the 'View
complete page listing' and all i end up with is the same page, with a # at
the end of the URL (eg http://localhost:8091/MochiKit#) and of course
nothing rendered into the page.

Thanks
Michael Weiner


Karl Guertin

unread,
Mar 1, 2006, 5:15:47 PM3/1/06
to turbo...@googlegroups.com
On 3/1/06, • Michael Weiner <hun...@userfriendly.net> wrote:
> Thank you very much that did the trick, although now i am up against the
> AJAX issue reported earlier by another poster, where i click on the 'View
> complete page listing' and all i end up with is the same page, with a # at
> the end of the URL (eg http://localhost:8091/MochiKit#) and of course
> nothing rendered into the page.

Two things happening there. TG 0.9 no longer exposes json by default.
You must add ``allow_json=True`` to pagelist's expose decorator. The
request param has also changed and the correct url is
"/pagelist?tg_format=json". Check the wiki20.tgz on my site for the
correct formatting if you're having trouble.

Michael Weiner

unread,
Mar 1, 2006, 5:23:27 PM3/1/06
to turbo...@googlegroups.com
Ahhh, i did grab that, and am checking it now, thanks again!

Michael Weiner
--

unread,
Mar 1, 2006, 5:42:13 PM3/1/06
to turbo...@googlegroups.com
I cant seem to find how you used the allow_json=True in the pagelist's
expose decorator. Can you be a bit more explicit? There is actually no
reference to that in anything in your tarball except the config.py and thats
set to false as a global config.

Michael Weiner
--

Karl Guertin

unread,
Mar 1, 2006, 5:54:45 PM3/1/06
to turbo...@googlegroups.com
On 3/1/06, • Michael Weiner <hun...@userfriendly.net> wrote:
> I cant seem to find how you used the allow_json=True in the pagelist's
> expose decorator. Can you be a bit more explicit? There is actually no
> reference to that in anything in your tarball except the config.py and thats
> set to false as a global config.

I had an incorrect version up. In addition, Kevin has updated the
preview site with the new tutorial he'd written but which wasn't
properly linked. He uses the global config setting.

http://www.turbogears.org/preview/docs/tutorials/wiki20/page6.html

javier

unread,
Mar 1, 2006, 6:08:50 PM3/1/06
to turbo...@googlegroups.com
Hi

I'm th "other" user that reported the bug. I'm still having that bug. Could
you please add your experiences to the bug report? Thanxs
http://trac.turbogears.org/turbogears/ticket/627
or here:
http://trac.turbogears.org/turbogears/ticket/620

Javier

Michael Weiner

unread,
Mar 1, 2006, 6:18:55 PM3/1/06
to turbo...@googlegroups.com


On 3/1/06, javier <javi...@gmail.com> wrote:
---------- Forwarded message ----------
From: javier <javi...@gmail.com>
To: turbo...@googlegroups.com
Date: Thu, 2 Mar 2006 00:08:50 +0100
Subject: [TurboGears] Re: tg 0.9 on macosx

Hi

I'm th "other" user that reported the bug. I'm still having that bug. Could
you please add your experiences to the bug report? Thanxs
http://trac.turbogears.org/turbogears/ticket/627
or here:
http://trac.turbogears.org/turbogears/ticket/620

Javier
--

I recieved the following response, and personally dont feel this is a bug, in as much as its more a syntactical change from 0.8x to 0.9x, turbogearsfmt to tg_format, turbogearsflash to tg_flash. Not sure thats really a 'registerable' 'bug'

Michael Weiner

javier

unread,
Mar 1, 2006, 6:27:42 PM3/1/06
to turbo...@googlegroups.com

Could you please check if the html rendered is correct? i.e. no strange \n
characters or similar issues? In my case the list page link didn't worked
because the javascript was incorrectly rendered and therefore my browser
couldn't find the appropiate js function to call and so the link changed to
http://localhost:8080/# but nothing occured.

Thanxs
javier

Karl Guertin

unread,
Mar 1, 2006, 6:38:07 PM3/1/06
to turbo...@googlegroups.com
On 3/1/06, javier <javi...@gmail.com> wrote:
> Could you please check if the html rendered is correct? i.e. no strange \n
> characters or similar issues?

javier, try upgrading to 0.9 alpha. I'm not sure if that will fix your
problem, but at least you'll be on a revision I have on my system and
can debug a bit better. You'll need to run:

easy_install -U setuptools
easy_install -U -f
http://www.turbogears.org/preview/download/index.html TurboGears

Then grab an 0.9 version of the wiki20 project:
http://www.turbogears.org/preview/docs/tutorials/wiki20/wiki20.tgz

And see if that doesn't fix your problems.

Michael Weiner

unread,
Mar 1, 2006, 11:42:05 PM3/1/06
to turbo...@googlegroups.com
Karl -

Thank you and Kevin for all the hard work, i seem to have gotten it working just great and am enjoying playing around. On another note, the turbotunes tutorial, i went through that as well, and that went well with one exception, and that was i am having a problem with the src='static/images/blah.png' statements in the kid file. I get no images, and get a 403 in the log. Any ideas?

Thanks
Michael
--
On 3/1/06, Karl Guertin <gray...@gmail.com> wrote:

javier

unread,
Mar 2, 2006, 1:40:18 AM3/2/06
to turbo...@googlegroups.com

I'm running tg 0.9a1.

Javier

unread,
Mar 2, 2006, 2:48:27 AM3/2/06
to turbo...@googlegroups.com
Hi

I've forgot to add that the new wiki20.tgz didn't worked for me. I'm
having a similar issue with catwalk. When I get to create a new page
the "save" button doesn't work. I've looked at the html output and I
have a \n included somewhere inside the code so konqueror doesn't
understand the html. I've already sent a mail to kevin telling this
error. Here's an extract of the html rendered:

[...]
</SCRIPT>
<SCRIPT>\n var tg_static_directory = '/tg_static';\n </SCRIPT>
</HEAD>
<BODY ONLOAD="catwalk.retrieveModels()">
[...]

I have to say I haven't touched any code in the example except the
devcfg.py file to point to a correct database, that's all.


Thanxs
javier


--

Javier

Reply all
Reply to author
Forward
0 new messages