Install trouble on Ubuntu 11.10 Server

180 views
Skip to first unread message

Jim Carroll

unread,
Apr 6, 2012, 2:50:13 PM4/6/12
to TurboGears
TG seems broken at the moment, installing on Ubuntu server 11.10
install seemed successful...
but paster serve gives me
from repoze.what.plugins.pylonshq import booleanize_predicates
ImportError: No module named pylonshq
and just running paster stand-alone gives me
from peak.util.decorators import decorate_assignment, decorate,
struct, \ ImportError: No module named decorators
Python 2.7 Tg 2.1
tg.devtools-2.1.4-py2.7.egg
"2.1.4 is already the active version..."

This happens regardless of if I've run python setup.py develop on an
empty app

What could I be doing wrong?

Michael Pedersen

unread,
Apr 6, 2012, 3:54:38 PM4/6/12
to turbo...@googlegroups.com
I just, from scratch, ran the following commands and got a working environment. I use Doug Hellman's virtualenvwrapper, so that's the minor difference at the beginning from normal:

mkvirtualenv --no-site-packages tgt
easy_install -i http://tg.gy/ tg.devtools
paster quickstart tgt #accepted defaults here
cd tgt
python setup.py develop -i http://tg.gy/
paster setup-app development.ini
paster serve development.ini


Aside from using (or not) virtualenvwrapper, did you do anything different from those commands? If so, what?


--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.




--
Michael J. Pedersen
My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
Google Talk: m.ped...@icelus.org -- Twitter: pedersentg

Jim Carroll

unread,
Apr 6, 2012, 3:54:42 PM4/6/12
to TurboGears
peak.util on my machine has the following modules (not decorator)

>>> import peak.util
>>> help(peak.util)

PACKAGE CONTENTS
addons
assembler
decorators
extremes
symbols

Jim Carroll

unread,
Apr 6, 2012, 3:58:15 PM4/6/12
to TurboGears
> mkvirtualenv --no-site-packages tgt
> easy_install -ihttp://tg.gy/tg.devtools

Thanks Michael, I've tried a few things, kinda flailing...
including apt-get install python-turbogears, and
$ easy_install -i http://www.turbogears.org/2.0/downloads/current/index
tg.devtools

in addition to
easy_install -i http://tg.gy/ tg.devtools

(which now tells me error: Installed distribution WebOb 1.0.8
conflicts with requirement WebOb>=1.1.1)

So I've got a mess on my hands. I'm going to try resetting the VM,
and just do what you just did.
Thanks.

Jim Carroll

unread,
Apr 6, 2012, 4:20:23 PM4/6/12
to TurboGears
Wow, much further this time, thank you Michael.

I completely cleaned with: $ apt-get uninstall python2.7
wiped out everything pythonic in /usr/local/lib, then re-installed
2.7.

then I followed your directions...

> mkvirtualenv --no-site-packages tgt
> easy_install -ihttp://tg.gy/tg.devtools
> paster quickstart tgt #accepted defaults here
> cd tgt
> python setup.py develop -ihttp://tg.gy/
> paster setup-app development.ini

ok up to here...

> paster serve development.ini

File "/usr/local/lib/python2.7/dist-packages/TurboGears2-2.1.4-
py2.7.egg/tg/configuration.py", line 680, in add_auth_middleware
from repoze.what.plugins.pylonshq import booleanize_predicates
ImportError: No module named pylonshq

investigating:

$ easy_install repose.what
repoze.what 1.0.9 is already the active version in easy-install.pth

>>> import repose.what.plugins as p
ImportError: No module named repose.what.plugins

So all I seem to need are the repoze pylons plugins.... hmmm...

Jim Carroll

unread,
Apr 6, 2012, 4:27:13 PM4/6/12
to TurboGears
The pylonshq module should be in the repose.what_pylons package... so
I did:

sudo easy_install -i http://tg.gy/ repoze.what_pylons
Searching for repoze.what-pylons
Best match: repoze.what-pylons 1.0
Processing repoze.what_pylons-1.0-py2.7.egg
repoze.what-pylons 1.0 is already the active version in easy-
install.pth

But still get

Jim Carroll

unread,
Apr 6, 2012, 4:54:37 PM4/6/12
to TurboGears
what's really strange is I _do_ have:

in /usr/local/lib/python2.7/dist-packages/repoze.what_pylons-1.0-
py2.7.egg/repoze/what/plugins/pylonshq

$ ls

__init__.py __init__.pyc protectors.py protectors.pyc utils.py
utils.pyc

huh?

utils.py (imported from __init__.py) even has

__all__ = ['is_met', 'not_met', 'booleanize_predicates',
'debooleanize_predicates']


So it _is_ there....


Jim Carroll

unread,
Apr 6, 2012, 5:04:19 PM4/6/12
to TurboGears
when I import, it's looking in plugins.sql.

It appears we have two competing repoze.what.plugins packages.




# /usr/local/lib/python2.7/dist-packages/repoze.what.plugins.sql-1.0.1-
py2.7.egg/repoze/what/__init__.pyc matches /usr/local/lib/python2.7/
dist-packages/repoze.what.plugins.sql-1.0.1-py2.7.egg/repoze/what/
__init__.py
import repoze.what # precompiled from /usr/local/lib/python2.7/dist-
packages/repoze.what.plugins.sql-1.0.1-py2.7.egg/repoze/what/
__init__.pyc
import repoze.what.plugins # directory /usr/local/lib/python2.7/dist-
packages/repoze.what.plugins.sql-1.0.1-py2.7.egg/repoze/what/plugins
import repoze.what.plugins # from /usr/local/lib/python2.7/dist-
packages/repoze.what.plugins.sql-1.0.1-py2.7.egg/repoze/what/plugins/
__init__.py
# wrote /usr/local/lib/python2.7/dist-packages/
repoze.what.plugins.sql-1.0.1-py2.7.egg/repoze/what/plugins/
__init__.pyc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>

Jim Carroll

unread,
Apr 6, 2012, 5:07:20 PM4/6/12
to TurboGears
removing what.plugins.sql gives the predictable:

.DistributionNotFound: repoze.what.plugins.sql>=1.0.1: Not Found for:
tgt (did you run python setup.py develop?)

and re-installing
$ sudo easy_install repoze.what.plugins.sql

gives
$ paster serve development.ini

from repoze.what.plugins.pylonshq import booleanize_predicates
ImportError: No module named pylonshq

again.

Muhammet S. AYDIN

unread,
Apr 6, 2012, 4:52:59 PM4/6/12
to turbo...@googlegroups.com
Jim,

aren't you using virtualenv?

2012/4/6 Jim Carroll <mrm...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.




--


Muhammet S. AYDIN
Acunn.com Developer

Jim Carroll

unread,
Apr 6, 2012, 5:16:06 PM4/6/12
to TurboGears
I'm on a dedicated machine. It's a virtual machine with a dedicated
environment.
If I created a virtual machine... I'd have to automate that at boot
time and all that.

Jim Carroll

unread,
Apr 6, 2012, 5:17:42 PM4/6/12
to TurboGears
I've also tried moving pylonshq to

/usr/local/lib/python2.7/dist-packages/
repoze.what.plugins.sql-1.0.1-py2.7.egg/repoze/what/plugins

and updating the __init__.py...
but there's something implicit going there, and it still won't import.

Jim Carroll

unread,
Apr 6, 2012, 5:18:48 PM4/6/12
to TurboGears
On Apr 6, 5:16 pm, Jim Carroll <mrma...@gmail.com> wrote:
> I'm on a dedicated machine.  It's a virtual machine with a dedicated
> environment.
> If I created a virtual ____environment____... I'd have to automate that at boot
> time and all that.

I activate my own virtual environment on my personal machine all the
time.
But this server is going to just have one project on it ever.

Michael Pedersen

unread,
Apr 7, 2012, 12:15:18 AM4/7/12
to turbo...@googlegroups.com
Sorry for taking so long. Been wrapping up my Friday.

We recommend using virtualenv. Strongly. virtualenv allows for what amounts to a private installation of Python, giving *only* the packages that are required to run TG itself. There's no automation of it, either. Instead of runing /usr/bin/python you would run (for example) /home/user/myproject/bin/python

And that's all the automation required. If you're using mod_wsgi, you point it at *that* installation of Python instead of the default system installation. It really does make life much easier for managing the installation of TG or, indeed, of any other complex Python program. Check out its description and documentation at http://pypi.python.org/pypi/virtualenv

I promise you that once you start using it, and see the benefits, you're not going to want to install any Python program any other way.

Now, to address your other issue, the "conflicting" packages: setuptools (and distribute, and pip) all support the idea of namespace'd packages. As a result, you can have packages that look like they're going to conflict, but in reality are actually loaded into the correct place in the hierarchy, allowing to do exactly what has been done with the repoze packages.

Now, I need to get to releasing 2.1.5. Pretty sure I just need to make the announcement, push the tags, and let it fly.

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.




--

Jim Carroll

unread,
Apr 9, 2012, 11:52:56 AM4/9/12
to TurboGears
Alright, thanks. With a virtual environment, I have it working.
I would expect turbogears to work in a normal Python environment,
maybe I'm just old fashioned.

Your help is very much appreciated,
-Jim

Alessandro Molina

unread,
Apr 9, 2012, 4:49:43 PM4/9/12
to turbo...@googlegroups.com
Well it works also in a normal python environment,
but you will have to check the versions requirements of the various
packages you have installed in your environment.

Some of them might obviously collide and that is the reason why
virtualenv has been created.

I would suggest you to always use virtualenv for all your projects,
you will avoid issues with version conflicts with every package or
framework you use, not only TurboGears.

Craig Small

unread,
Apr 9, 2012, 10:58:11 PM4/9/12
to turbo...@googlegroups.com
On Mon, Apr 09, 2012 at 10:49:43PM +0200, Alessandro Molina wrote:
> I would suggest you to always use virtualenv for all your projects,
> you will avoid issues with version conflicts with every package or
> framework you use, not only TurboGears.

Is that also how you run your production environments? I've got a
development virtualenv but still working out how best to deploy my
project; either as me deploying it or writing up some document to tell
others how to do it.

- Craig
--
Craig Small VK2XLZ http://enc.com.au/ csmall at : enc.com.au
Debian GNU/Linux http://www.debian.org/ csmall at : debian.org
GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5

Michael Pedersen

unread,
Apr 9, 2012, 11:05:47 PM4/9/12
to turbo...@googlegroups.com
Actually, it *is* how I deploy to production. It ensures that I have complete control of the versions of the packages used, not the system.

Usually, the system package manager is pretty good for most things. For this sort of situation, though, it can make problems. I avoid it.

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

Reply all
Reply to author
Forward
0 new messages