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
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
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.
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
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
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
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.
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...
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.