quickstart install error for 0.4rc1: ImportError: No module named setup

41 views
Skip to first unread message

JJBigThoughts

unread,
Dec 26, 2007, 3:50:55 PM12/26/07
to tg-registration
I'm trying to get started with registration! I'm supposed to have the
site live before this weekend in order that I'll have kept my New
Year's resolution. I'm fairly new to TG, but things have been coming
along fine so far. I tried registration 0.3, but ditched it when I
realized it wouldn't work with python 2.5.
Any help would be appreciated. I feel like I am really missing
something basic and important.
Thanks,
JJ

My system
==========
using turbo gears 1.0.3.2
python 2.5.1

==================== how I installed =============================
elegantlap:turbo_gears jj$ easy_install http://tg-registration.googlecode.com/svn/trunk/
Downloading http://tg-registration.googlecode.com/svn/trunk/
Doing subversion checkout from http://tg-registration.googlecode.com/svn/trunk/
to /var/folders/bn/bnRPiM2nFfaHTg7aYshF-k+++TU/-Tmp-/easy_install-
qg34rB/trunk
Processing trunk
Running setup.py -q bdist_egg --dist-dir /var/folders/bn/
bnRPiM2nFfaHTg7aYshF-k+++TU/-Tmp-/easy_install-qg34rB/trunk/egg-dist-
tmp-Nqo7vg
Adding registration 0.4rc1 to easy-install.pth file

Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/registration-0.4rc1-py2.5.egg
Processing dependencies for registration==0.4rc1
Finished processing dependencies for registration==0.4rc1




===================== quickstart ============================
elegantlap:turbo_gears jj$ tg-admin quickstart -t registration
Enter project name: registration6
Enter package name [registration6]:
Do you need Identity (usernames/passwords) in this project? [no] yes
Selected and implied templates:
TurboGears#tgbase tg base template
registration#registration Provides a template for simple user
registraton and verification.

Variables:
egg: registration6
elixir: False
identity: sqlobject
package: registration6
project: registration6
sqlalchemy: False
Creating template tgbase
Creating directory ./registration6
Recursing into +einame+.egg-info
Creating ./registration6/registration6.egg-info/
Copying PKG-INFO to ./registration6/registration6.egg-info/PKG-
INFO
Copying paster_plugins.txt to ./registration6/registration6.egg-
info/paster_plugins.txt
Copying sqlobject.txt_tmpl to ./registration6/registration6.egg-
info/sqlobject.txt
Recursing into +package+
Creating ./registration6/registration6/
Copying __init__.py_tmpl to ./registration6/registration6/
__init__.py
Copying release.py_tmpl to ./registration6/registration6/
release.py
Recursing into static
Creating ./registration6/registration6/static/
Recursing into css
Creating ./registration6/registration6/static/css/
Copying empty to ./registration6/registration6/static/css/
empty
Recursing into images
Creating ./registration6/registration6/static/images/
Copying favicon.ico to ./registration6/registration6/static/
images/favicon.ico
Copying tg_under_the_hood.png to ./registration6/registration6/
static/images/tg_under_the_hood.png
Copying under_the_hood_blue.png to ./registration6/
registration6/static/images/under_the_hood_blue.png
Recursing into javascript
Creating ./registration6/registration6/static/javascript/
Copying empty to ./registration6/registration6/static/
javascript/empty
Recursing into templates
Creating ./registration6/registration6/templates/
Copying __init__.py_tmpl to ./registration6/registration6/
templates/__init__.py
Creating template registration
Recursing into +package+
Recursing into config
Creating ./registration6/registration6/config/
Copying registration.cfg to ./registration6/registration6/config/
registration.cfg
Recursing into tests
Creating ./registration6/registration6/tests/
Copying test_registration.py_tmpl to ./registration6/
registration6/tests/test_registration.py
Traceback (most recent call last):
File "/usr/local/bin/tg-admin", line 8, in <module>
load_entry_point('TurboGears==1.0.3.2', 'console_scripts', 'tg-
admin')()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/TurboGears-1.0.3.2-py2.5.egg/turbogears/
command/base.py", line 389, in main
command.run()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/TurboGears-1.0.3.2-py2.5.egg/turbogears/
command/quickstart.py", line 214, in run
imp.load_module("setup", *imp.find_module("setup", ["."]))
ImportError: No module named setup

JJBigThoughts

unread,
Dec 27, 2007, 3:44:07 PM12/27/07
to tg-registration
Upon further reflection/digging, I submitted this as bug #5 (http://
code.google.com/p/tg-registration/issues/detail?id=5). My new-to-all-
of-this eyes thinks that rc1 might be packaged incorrectly. I could
be mistaken.

Patrick Lewis

unread,
Dec 27, 2007, 3:50:14 PM12/27/07
to tg-registration


On Dec 26, 3:50 pm, JJBigThoughts <jjroh...@gmail.com> wrote:
> I'm trying to get started with registration! I'm supposed to have the
> site live before this weekend in order that I'll have kept my New
> Year's resolution. I'm fairly new to TG, but things have been coming
> along fine so far. I tried registration 0.3, but ditched it when I
> realized it wouldn't work with python 2.5.
> Any help would be appreciated. I feel like I am really missing
> something basic and important.
> Thanks,
> JJ
>

It looks like not everything got pulled from SVN, but I can't say for
sure what is going on. Can you try using the tarball?

easy_install -f http://tg-registration.googlecode.com/files/registration-0.4rc1.tar.gz
-U registration

- Did you run into problems with 0.3? I can't say I've tried it with
2.5, but I don't know why it wouldn't work. I think 0.4rc1 is cleaner
and would suggest it for a new project if possible, but if you ran
into problems I would like to fix them.

JJBigThoughts

unread,
Dec 27, 2007, 5:23:38 PM12/27/07
to tg-registration
I do not have the same problem with 0.3.

When I look at the tar file, I can see the desired files, but
executing "easy_install -f http://tg-registration.googlecode.com/files/registration-0.4rc1.tar.gz
-U registration" doesn't seem to pull them in.

I'm very new to easy_install, but its sort of acting as if it is using
a badly-cached copy of registration.

I'll look into how to force an absolutely clean install.

Thanks!

Patrick Lewis

unread,
Dec 28, 2007, 2:06:37 PM12/28/07
to tg-registration
On Dec 27, 5:23 pm, JJBigThoughts <jjroh...@gmail.com> wrote:
> I do not have the same problem with 0.3.
>
> When I look at the tar file, I can see the desired files, but
> executing "easy_install -fhttp://tg-registration.googlecode.com/files/registration-0.4rc1.tar.gz
> -U registration" doesn't seem to pull them in.
>
> I'm very new to easy_install, but its sort of acting as if it is using
> a badly-cached copy of registration.
>
> I'll look into how to force an absolutely clean install.
>
> Thanks!

There are two problems. The first you identified, for whatever reason
not all the templates were being picked up. I changed setup.py a bit,
and you should be able try installing agiain from svn and see all the
templates.

The second issue was that 0.4 isn't so strict about the turbogears
templates that are required. I think this is good for flexibility, but
it makes things a bit more convoluted for brand new tg-admin
quickstart installs. This command works for me:

tg-admin quickstart -t 'turbogears registration'

this forces tg-admin to use both the normal 'turbogears' templates and
the registration templates.

Hope that helps, and that I haven't messed up your New Year's
resolution too badly. :-)

JJBigThoughts

unread,
Jan 8, 2008, 9:52:27 AM1/8/08
to tg-registration
Great!
This seems to solve the problem. Thanks.
My resolution, btw, was completely messed up - I insist that you
absolve me of at least 2 of my 3 resolutions for next year, namely:
- exercise more
- drink less
- stop procrastinating
Pick your favorites.


For the record, here is how I quick-started this:
easy_install TurboMail
easy_install http://tg-registration.googlecode.com/svn/trunk/
tg-admin quickstart -t 'turbogears registration'
project=>extgRegistration4
identity=>yes
cd extgRegistration4
edit config/registration.cfg
# [put this right under the [global] line at the top
mail.on = True
mail.server = 'smtp.gmail.com'
mail.username = 'YYY@blah_com'
mail.password = 'XXX'
tg-admin shell
import registration.model as model
model.create_registration_tables()
quit()
[hint: you won't see the new tables in cakewalk]
modify templates/welcome.kid thus:
===================== templates/welcome.kid -BEGIN-
=========================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/
kid/ns#"
py:extends="'master.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"
py:replace="''"/>
<title>Welcome to TurboGears</title>
</head>
<body>

<a href="/login">login</a>
<br /> Hello <span py:if="not tg.identity.anonymous">
Welcome ${tg.identity.user.display_name}.
<a href="${tg.url('/logout')}">Logout</a>
</span>

<br />
<a href="${tg.url('/registration')}">Register</a>
<br />
<a href="${tg.url('/registration/lost_password')}">Lost Passoword</
a>
<br />
<a href="${tg.url('/registration/edit_user')}">Edit User</a>
</body>
</html>

===================== templates/welcome.kid -END-
=========================

Edit controllers.py thus (modifications to the default file is where
'by jjr' is in the comment)
===================== controllers.py -BEGIN-
==============================
from turbogears import controllers, expose, flash
# from model import *
from turbogears import identity, redirect
from cherrypy import request, response
# from extgregistration4 import json
# import logging
# log = logging.getLogger("extgregistration4.controllers")

import pkg_resources #added by jjr 20080107
pkg_resources.require("registration==0.4rc1") #added by jjr 20080107

class Root(controllers.RootController):
import registration.controllers #added by jjr 20080107
registration = registration.controllers.UserRegistration() #added
by jjr 20080107

@expose(template="extgregistration4.templates.welcome")
# @identity.require(identity.in_group("admin"))
def index(self):
import time
# log.debug("Happy TurboGears Controller Responding For Duty")
flash("Your application is now running")
return dict(now=time.ctime())

@expose(template="extgregistration4.templates.registration.login")
#modified by jjr 20080107
def login(self, forward_url=None, previous_url=None, *args, **kw):

if not identity.current.anonymous \
and identity.was_login_attempted() \
and not identity.get_identity_errors():
raise redirect(forward_url)

forward_url=None
previous_url= request.path

if identity.was_login_attempted():
msg=_("The credentials you supplied were not correct or "
"did not grant access to this resource.")
elif identity.get_identity_errors():
msg=_("You must provide your credentials before accessing
"
"this resource.")
else:
msg=_("Please log in.")
forward_url= request.headers.get("Referer", "/")

response.status=403
return dict(message=msg, previous_url=previous_url,
logging_in=True,
original_parameters=request.params,
forward_url=forward_url)

@expose()
def logout(self):
identity.current.logout()
raise redirect("/")

=================== controllers.py -END- =======================
python start-extgregistration4.py

JJBigThoughts

unread,
Jan 8, 2008, 10:30:37 AM1/8/08
to tg-registration
FYI: This issue was reported by in googlecode.com as issue #5 (http://
code.google.com/p/tg-registration/issues/detail?id=5)
Reply all
Reply to author
Forward
0 new messages