Upgrade 1.9.7 -> 2.0b1 without Virtualenv

18 views
Skip to first unread message

Taavi Kuusik

unread,
Jan 1, 2009, 8:05:51 AM1/1/09
to turbo...@googlegroups.com
Hello!


Is there any way to upgrade from 1.9.7 to 2.0b1 without manually
deleting all 1.9.7 packages? I'm unable to use virtualenv since it
doesn't play well with Mac (or Macports).

It seems the usual easy_install -U creates a broken build of Turbogears.
Does anyone have an idea how to get up and running the easiest in this
situation?

After doing: "sudo easy_install --upgrade -i
http://www.turbogears.org/2.0/downloads/current/index tg.devtools" which
completes successfully I get the following output from quickstart:

paster quickstart
Enter project name: turbo2test
Enter package name [turbo2test]:
Do you need authentication and authorization in this project? [yes]
Selected and implied templates:
tg.devtools#turbogears2 TurboGears 2.0 Standard Quickstart Template

Variables:
auth: sqlalchemy
egg: turbo2test
package: turbo2test
project: turbo2test
sqlalchemy: True
sqlobject: False
tgversion: 1.9.7b2
<--SNIP-->
Running
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
setup.py egg_info
Manually creating paster_plugins.txt (deprecated! pass a paster_plugins
keyword to setup() instead)
Adding PasteScript to paster_plugins.txt
Adding Pylons to paster_plugins.txt
Adding TurboGears2 to paster_plugins.txt
Adding tg.devtools to paster_plugins.txt
Traceback (most recent call last):
File "/usr/bin/paster", line 8, in <module>
load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
File
"/opt/local/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg/paste/script/command.py",
line 84, in run
invoke(command, command_name, options, args[1:])
File
"/opt/local/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg/paste/script/command.py",
line 123, in invoke
exit_code = runner.run(args)
File
"/opt/local/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg/paste/script/command.py",
line 218, in run
result = self.command()
File
"/opt/local/lib/python2.5/site-packages/tg.devtools-2.0b1-py2.5.egg/devtools/commands/quickstart.py",
line 230, in command
imp.load_module("setup", *imp.find_module("setup", ["."]))
File "./setup.py", line 39, in <module>
""",
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py",
line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/opt/local/lib/python2.5/site-packages/setuptools/dist.py", line
223, in __init__
_Distribution.__init__(self,attrs)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py",
line 274, in __init__
self.finalize_options()
File "/opt/local/lib/python2.5/site-packages/setuptools/dist.py", line
256, in finalize_options
ep.load()(self, ep.name, value)
File "/opt/local/lib/python2.5/site-packages/pkg_resources.py", line
1913, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File
"/opt/local/lib/python2.5/site-packages/Babel-0.9.3-py2.5.egg/babel/messages/__init__.py",
line 16, in <module>
from babel.messages.catalog import *
File
"/opt/local/lib/python2.5/site-packages/Babel-0.9.3-py2.5.egg/babel/messages/catalog.py",
line 30, in <module>
from babel.dates import format_datetime
File
"/opt/local/lib/python2.5/site-packages/Babel-0.9.3-py2.5.egg/babel/dates.py",
line 34, in <module>
LC_TIME = default_locale('LC_TIME')
File
"/opt/local/lib/python2.5/site-packages/Babel-0.9.3-py2.5.egg/babel/core.py",
line 629, in default_locale
return '_'.join(filter(None, parse_locale(locale)))
File
"/opt/local/lib/python2.5/site-packages/Babel-0.9.3-py2.5.egg/babel/core.py",
line 737, in parse_locale
raise ValueError('expected only letters, got %r' % lang)
ValueError: expected only letters, got 'utf-8'


Thanks in advance,


Taavi Kuusik

Diez B. Roggisch

unread,
Jan 2, 2009, 11:55:42 AM1/2/09
to turbo...@googlegroups.com
Taavi Kuusik schrieb:

> Hello!
>
>
> Is there any way to upgrade from 1.9.7 to 2.0b1 without manually
> deleting all 1.9.7 packages? I'm unable to use virtualenv since it
> doesn't play well with Mac (or Macports).

This is plain wrong. I'm using virtualenv happily on OSX (tiger and
leopard).

As you mention macports (right now, I'm fighting with that beast, but
that's unrelated...) - you certainly should *not* use any python-build
of them because they aren't python framework builds.

Nevertheless, they should not make any troubles with VE.

So if there are any, they must be special to your system, and you should
fix them.

> It seems the usual easy_install -U creates a broken build of Turbogears.
> Does anyone have an idea how to get up and running the easiest in this
> situation?


If you insist on not using VE for whatevere reasons, there is no easy
way short of removing all TG2-dependent packages by hand.

Diez

Florent Aide

unread,
Jan 2, 2009, 12:04:18 PM1/2/09
to turbo...@googlegroups.com
On Fri, Jan 2, 2009 at 5:55 PM, Diez B. Roggisch <de...@web.de> wrote:
>
> Taavi Kuusik schrieb:
>> Hello!
>>
>>
>> Is there any way to upgrade from 1.9.7 to 2.0b1 without manually
>> deleting all 1.9.7 packages? I'm unable to use virtualenv since it
>> doesn't play well with Mac (or Macports).
>
> This is plain wrong. I'm using virtualenv happily on OSX (tiger and
> leopard).

hum... With the system python on Leopard I have encountered problem
because the --no-site-packages flag was not respected, and some people
reported the same. So I would say this is not _plain_ wrong.

I "fixed" my problem by installing a vanilla python downloaded from
python.org. Once I rebooted it was my default python in the shell and
I could use VE without an itch.

Do NOT remove the system python provided in osx though, this would
certainly lead to problems everywhere.

To be able to compile C extensions I had to install Xcode, but this
should not be a problem since we (try to) provide pre-compiled
versions of all our C dependencies.

Florent.

Diez B. Roggisch

unread,
Jan 2, 2009, 12:22:30 PM1/2/09
to turbo...@googlegroups.com
Florent Aide schrieb:

> On Fri, Jan 2, 2009 at 5:55 PM, Diez B. Roggisch <de...@web.de> wrote:
>> Taavi Kuusik schrieb:
>>> Hello!
>>>
>>>
>>> Is there any way to upgrade from 1.9.7 to 2.0b1 without manually
>>> deleting all 1.9.7 packages? I'm unable to use virtualenv since it
>>> doesn't play well with Mac (or Macports).
>> This is plain wrong. I'm using virtualenv happily on OSX (tiger and
>> leopard).
>
> hum... With the system python on Leopard I have encountered problem
> because the --no-site-packages flag was not respected, and some people
> reported the same. So I would say this is not _plain_ wrong.

Works for me. I just double checked that - as I usually don't use the
system python anyway.

So maybe the plain wrong was a bit strong, but I still believe the way
to go is to use VE. And to fix that, if needed.

Diez

Taavi Kuusik

unread,
Jan 3, 2009, 5:53:01 AM1/3/09
to turbo...@googlegroups.com
I guess installing python from source is the way to go then. So far I hadn't had any problems
with the Macports python - all my other modules worked fine including nose, psycopg2 and
everything TG uses. Virtualenv --no-site-packages fails with
"ImportError: No module named _md5" even though the same import works when I execute
it from my python shell. The issue is also reported on virtualenv list in September, but there
were no replies there, so I assumed I was out of luck. Will try installing vanilla python next.

On the other hand, shouldn't the easy_install --upgrade work for TG2 anyway? It seems I'm
not the only one with that problem either.


Taavi

Mark Ramm

unread,
Jan 3, 2009, 8:44:28 AM1/3/09
to turbo...@googlegroups.com
> On the other hand, shouldn't the easy_install --upgrade work for TG2 anyway?
> It seems I'm
> not the only one with that problem either.

I think it works, but we haven't documented how to do it. You have
to upgrade tg.devtools and some other packages as well.

Also, there seems to be some people having problems getting
zope.sqlalchemy to install from our index, but it works here, and it's
also available at pypi so if that's what's hanging you up you can
easy_install it before starting the tg2 upgrade process.

--Mark Ramm

Diez B. Roggisch

unread,
Jan 3, 2009, 9:29:45 AM1/3/09
to turbo...@googlegroups.com
> I guess installing python from source is the way to go then. So far I
> hadn't had any problems
> with the Macports python - all my other modules worked fine including
> nose, psycopg2 and
> everything TG uses. Virtualenv --no-site-packages fails with
> "ImportError: No module named _md5" even though the same import works
> when I execute
> it from my python shell. The issue is also reported on virtualenv list
> in September, but there
> were no replies there, so I assumed I was out of luck. Will try
> installing vanilla python next.


I can only guess, but it appears as if there are somehow mixups between
fat and native binaries which could explain that.

I know that the system python comes with a fat binary, and the usually
installers do so as well. macports are native only, and of course if you
build stuff yourself, you decide.

Given the various problems one can have getting 3rd-party-libs to become
fat binaries (and thus become usable by python-extensions), a vanilla
python build as framework (!!!) would be a good approach, yes.


> On the other hand, shouldn't the easy_install --upgrade work for TG2
> anyway? It seems I'm
> not the only one with that problem either.

setuptools is weak on upgrades & even weaker on de-installations.

And what it can't solve are versionsets that interdepend on each other
without beeing properly declared by application code. Few if any apps do
that. So even if upgrade worked, it has the potential to destroy other
working apps.

That is the reason I tend to create a virtualenv for *each* project I
have. It's easy, cheap & spares me a lot of troubles.

I even created a VE-manager that I might release if I find time that
helps with this. And there is at least one other out there, by doug
hellman I believe (but am not sure)

Diez

kfrancoi

unread,
Jan 3, 2009, 4:01:44 PM1/3/09
to turbo...@googlegroups.com

Hello Florent,

I've been using turbogears 2.0 since a week nw and it's working perfectly in
my Windows computer. But I tried to install it on my Mac (10.5.6) and I got
the same error than Taavi when trying to create a new project using 'paster
quickstart' in a vitualenv (ValueError: expected only letters, got
'utf-8'). You said that you fixed your problem installing a vanilla version
of python. What does that mean exactly and where do you install it ? Is it
in the virtualenv ?

Thanks a lot :-)

Kevin
--
View this message in context: http://www.nabble.com/Upgrade-1.9.7--%3E-2.0b1-without-Virtualenv-tp21253678p21269346.html
Sent from the Turbogears General mailing list archive at Nabble.com.

Florent Aide

unread,
Jan 3, 2009, 6:30:03 PM1/3/09
to turbo...@googlegroups.com
On Sat, Jan 3, 2009 at 10:01 PM, kfrancoi <kfra...@gmail.com> wrote:
>
>
> Hello Florent,
>
> I've been using turbogears 2.0 since a week nw and it's working perfectly in
> my Windows computer. But I tried to install it on my Mac (10.5.6) and I got
> the same error than Taavi when trying to create a new project using 'paster
> quickstart' in a vitualenv (ValueError: expected only letters, got
> 'utf-8'). You said that you fixed your problem installing a vanilla version
> of python. What does that mean exactly and where do you install it ? Is it
> in the virtualenv ?

I meant that I downloaded and installed python 2.5 from the python.org website:

http://www.python.org/ftp/python/2.5.4/python-2.5.4-macosx.dmg

and then used only this one python instead of the one provided by
apple in the default installation.

Florent.

kfrancoi

unread,
Jan 4, 2009, 5:44:56 PM1/4/09
to TurboGears
I upgraded my version of python to 2.5.4 and install "virtualenv" with
it. The installation of TG2 which complete successfully but I still
get the same output error with "quickstart" :

#####
Selected and implied templates:
tg.devtools#turbogears2 TurboGears 2.0 Standard Quickstart Template

Variables:
auth: sqlalchemy
egg: testtg2
package: testtg2
project: testtg2
sqlalchemy: True
sqlobject: False
tgversion: 2.0b1
Creating template turbogears2
Creating directory ./testtg2

<--- CUT --->
Adding tg.devtools to paster_plugins.txt
Traceback (most recent call last):
File "/Users/kfrancoi/Projects/turboGear/tg2env/bin/paster", line 8,
in <module>
load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')
()
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/PasteScript-1.7.3-py2.5.egg/paste/script/command.py", line
84, in run
invoke(command, command_name, options, args[1:])
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/PasteScript-1.7.3-py2.5.egg/paste/script/command.py", line
123, in invoke
exit_code = runner.run(args)
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/PasteScript-1.7.3-py2.5.egg/paste/script/command.py", line
218, in run
result = self.command()
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/tg.devtools-2.0b1-py2.5.egg/devtools/commands/quickstart.py",
line 230, in command
imp.load_module("setup", *imp.find_module("setup", ["."]))
File "./setup.py", line 39, in <module>
""",
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/setuptools-0.6c9-py2.5.egg/setuptools/dist.py", line 223, in
__init__
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/distutils/dist.py", line 267, in __init__
self.finalize_options()
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/setuptools-0.6c9-py2.5.egg/setuptools/dist.py", line 256, in
finalize_options
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/setuptools-0.6c9-py2.5.egg/pkg_resources.py", line 1913, in
load
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/Babel-0.9.3-py2.5.egg/babel/messages/__init__.py", line 16,
in <module>
from babel.messages.catalog import *
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/Babel-0.9.3-py2.5.egg/babel/messages/catalog.py", line 30, in
<module>
from babel.dates import format_datetime
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/Babel-0.9.3-py2.5.egg/babel/dates.py", line 34, in <module>
LC_TIME = default_locale('LC_TIME')
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/Babel-0.9.3-py2.5.egg/babel/core.py", line 629, in
default_locale
return '_'.join(filter(None, parse_locale(locale)))
File "/Users/kfrancoi/Projects/turboGear/tg2env/lib/python2.5/site-
packages/Babel-0.9.3-py2.5.egg/babel/core.py", line 737, in
parse_locale
raise ValueError('expected only letters, got %r' % lang)
ValueError: expected only letters, got 'utf-8'
#####

Of course, I tried to install TG2 on a windows and a linux computer...
and it works fine. I guess I must have done something wrong on my MAC
even if I just resinstall OSX a couple of days ago..
I will try to track to problem as it seems to be an error specific to
a mac ('utf-8'). But it would also make me happy if anyone has a
solution to this problem...

Thanks a lot

Kevin

On Jan 4, 12:30 am, "Florent Aide" <florent.a...@gmail.com> wrote:

Mark Ramm

unread,
Jan 4, 2009, 7:30:36 PM1/4/09
to turbo...@googlegroups.com
> Of course, I tried to install TG2 on a windows and a linux computer...
> and it works fine. I guess I must have done something wrong on my MAC
> even if I just resinstall OSX a couple of days ago..
> I will try to track to problem as it seems to be an error specific to
> a mac ('utf-8'). But it would also make me happy if anyone has a
> solution to this problem...

Yea, I'm not sure what's happening for you, but I run tg2 on osx all
the time. And I just use MacPython from the python.org website.

it looks like the default vale for the locale is a utf8 string, I'm
wondering what it is...

Jorge Vargas

unread,
Jan 5, 2009, 7:43:47 PM1/5/09
to turbo...@googlegroups.com
On Sat, Jan 3, 2009 at 6:53 AM, Taavi Kuusik <taavi....@gmail.com> wrote:
>
>
> I guess installing python from source is the way to go then. So far I hadn't
> had any problems
> with the Macports python - all my other modules worked fine including nose,
> psycopg2 and
> everything TG uses. Virtualenv --no-site-packages fails with
> "ImportError: No module named _md5" even though the same import works when I
> execute
> it from my python shell. The issue is also reported on virtualenv list in
> September, but there
> were no replies there, so I assumed I was out of luck. Will try installing
> vanilla python next.
>
> On the other hand, shouldn't the easy_install --upgrade work for TG2 anyway?
> It seems I'm
> not the only one with that problem either.

I'm not a mac user, but I assure you that
$ easy_install -U -i
http://www.turbogears.org/2.0/downloads/current/index tg.devtools

works fine on Linux. I got a doc patch I haven't finish to add this to
http://turbogears.org/2.0/docs/main/DownloadInstall.html

But as everyone else has pointed out, you should (almost to the point
of must) use a venv. The reason's a plenty but the most important one
is that no package manager (mac,linux,bsd or whatever) plays well with
setuptools and the current solution (pythonwide) is to avoid
system-packages, this is specially important for development, and even
more important for webdevelopment, where there is no real boundary
between user and developer.

Reply all
Reply to author
Forward
0 new messages