Problems while installing with Python 3.2

181 views
Skip to first unread message

Mariano Mara

unread,
Apr 8, 2012, 11:00:41 AM4/8/12
to pylons-...@googlegroups.com
Hi guys, I'm trying to switch to Python 3 for my new project but I have encountered a couple of problems I'm not sure how to solve.
The main question would be: do you guys have lingua or deformdemo running under Python 3.2? How did you guys solve the errors while installing? (see below the errors I'm getting).

First I checked out the code for deform demo and when I try to install it for develop I get hit by an error with babel:

$ python setup.py develop
Traceback (most recent call last):
  File "setup.py", line 71, in <module>
    setup(**setupkw)
  File "/home/mariano/Code/Python3.2/lib/python3.2/distutils/core.py", line 109, in setup
    _setup_distribution = dist = klass(attrs)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/dist.py", line 225, in __init__
    _Distribution.__init__(self,attrs)
  File "/home/mariano/Code/Python3.2/lib/python3.2/distutils/dist.py", line 261, in __init__
    self.finalize_options()
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/dist.py", line 258, in finalize_options
    ep.load()(self, ep.name, value)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 1990, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/babel/__init__.py", line 29, in <module>
    from babel.core import *
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/babel/core.py", line 261
    retval += ' (%s)' % u', '.join(details)
                            ^
SyntaxError: invalid syntax

So I went back and tried to install lingua and Babel manually to see if that helped me. Unfortunately I got an error with xlwt (beats me what excel has to do with translations):

$ easy_install Babel lingua
Searching for Babel
Best match: Babel 0.9.6
Adding Babel 0.9.6 to easy-install.pth file
Installing pybabel script to /home/mariano/Code/Project/env/bin

Using /home/mariano/Code/Project/env/lib/python3.2/site-packages
Processing dependencies for Babel
Finished processing dependencies for Babel
Searching for lingua
Best match: lingua 1.3
Processing lingua-1.3-py3.2.egg
lingua 1.3 is already the active version in easy-install.pth
Installing po-to-xls script to /home/mariano/Code/Project/env/bin
Installing xls-to-po script to /home/mariano/Code/Project/env/bin
Installing polint script to /home/mariano/Code/Project/env/bin

Using /home/mariano/Code/Project/env/lib/python3.2/site-packages/lingua-1.3-py3.2.egg
Processing dependencies for lingua
Searching for xlwt
Reading http://pypi.python.org/simple/xlwt/
Reading https://secure.simplistix.co.uk/svn/xlwt/trunk
Best match: xlwt 0.7.3
Downloading http://pypi.python.org/packages/source/x/xlwt/xlwt-0.7.3.tar.gz#md5=ff97fbfe297b84b2993c9d86f40a91fe
Processing xlwt-0.7.3.tar.gz
Running xlwt-0.7.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-v5rydu/xlwt-0.7.3/egg-dist-tmp-_t9rft
Traceback (most recent call last):
  File "/home/mariano/Code/Project/env/bin/easy_install", line 9, in <module>
    load_entry_point('distribute==0.6.24', 'console_scripts', 'easy_install')()
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 1883, in main
    with_ei_usage(lambda:
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 1864, in with_ei_usage
    return f()
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 1887, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/home/mariano/Code/Python3.2/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/mariano/Code/Python3.2/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/home/mariano/Code/Python3.2/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 349, in run
    self.easy_install(spec, not self.no_deps)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 589, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 624, in install_item
    self.process_distribution(spec, dists[0], deps, "Using")
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 673, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 576, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 822, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 834, in obtain
    return installer(requirement)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 589, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 619, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 809, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 1086, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/easy_install.py", line 1075, in run_setup
    run_setup(setup_script, args)
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/sandbox.py", line 31, in run_setup
    lambda: exec(compile(open(
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/sandbox.py", line 73, in run
    return func()
  File "/home/mariano/Code/Project/env/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/sandbox.py", line 34, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'})
  File "setup.py", line 5, in <module>
    #
  File "/tmp/easy_install-v5rydu/xlwt-0.7.3/xlwt/__init__.py", line 10, in <module>
ImportError: No module named Workbook


TIA for any help you can provide.
Mariano


Ottavio

unread,
Apr 10, 2012, 4:47:51 AM4/10/12
to pylons-...@googlegroups.com
Il giorno domenica 8 aprile 2012 17:00:41 UTC+2, Mariano Mara ha scritto:
Hi guys, I'm trying to switch to Python 3 for my new project but I have encountered a couple of problems I'm not sure how to solve.
The main question would be: do you guys have lingua or deformdemo running under Python 3.2? How did you guys solve the errors while installing? (see below the errors I'm getting).

babel and lingua are not currently python3 compatible. There's a repository with the necessary patches, but there's no official release yet.

Since these patches have been available since several months, I really wonder why they don't release a python3-friendly version of babel and lingua...

This is what keeps me stuck with python 2.7 with pyramid, and it's annoying... But it is not pyramid's fault.

Ottavio

Mariano Mara

unread,
Apr 10, 2012, 11:23:15 AM4/10/12
to pylons-...@googlegroups.com


2012/4/10 Ottavio <ott...@campana.vi.it>

Thanks for your answer.  I have found https://bitbucket.org/felixschwarz/babel-py3k for babel (although it still has issues). I forked it and I will try to see how many problems I find and I can fix although I'm not sure if this is the most up2date repo for babel. Do you know of another one? If you know where I can find the lingua repo for py3k I would appreciate it.

TIA,
Mariano

Ottavio

unread,
Apr 11, 2012, 3:19:14 AM4/11/12
to pylons-...@googlegroups.com
Il giorno martedì 10 aprile 2012 17:23:15 UTC+2, Mariano Mara ha scritto:
Thanks for your answer.  I have found https://bitbucket.org/felixschwarz/babel-py3k for babel (although it still has issues). I forked it and I will try to see how many problems I find and I can fix although I'm not sure if this is the most up2date repo for babel. Do you know of another one? If you know where I can find the lingua repo for py3k I would appreciate it.

I know it and I think it works.

But I consider a pain the fact that babel guys don't release a new version for python3.

I want to be able to install with pip or easy_install, I don't want to have to check that out from git...

Ottavio
Reply all
Reply to author
Forward
0 new messages