Issue #1 invalid

Cannot Install on Ubuntu 12.04 / Python 2.7.3

William Janning
created an issue

I've installed 3to2 as well as the libenchant libraries and pyenchant. But when I go to install translit-0.2 I get syntax errors:

com:~/downloads/translit-0.2a1$ sudo python setup.py install running install Checking .pth file support in /usr/local/lib/python2.7/dist-packages/ /usr/bin/python -E -c pass TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files running bdist_egg running egg_info creating build/py2k/translit.egg-info writing requirements to build/py2k/translit.egg-info/requires.txt writing build/py2k/translit.egg-info/PKG-INFO writing top-level names to build/py2k/translit.egg-info/top_level.txt writing dependency_links to build/py2k/translit.egg-info/dependency_links.txt writing manifest file 'build/py2k/translit.egg-info/SOURCES.txt' reading manifest file 'build/py2k/translit.egg-info/SOURCES.txt' writing manifest file 'build/py2k/translit.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/translit copying build/py2k/translit/spell.py -> build/lib.linux-x86_64-2.7/translit copying build/py2k/translit/iconv.py -> build/lib.linux-x86_64-2.7/translit copying build/py2k/translit/init.py -> build/lib.linux-x86_64-2.7/translit copying build/py2k/translit/downgrade.py -> build/lib.linux-x86_64-2.7/translit copying build/py2k/translit/upgrade.py -> build/lib.linux-x86_64-2.7/translit copying build/py2k/translit/codec.py -> build/lib.linux-x86_64-2.7/translit creating build/lib.linux-x86_64-2.7/translit/backports copying build/py2k/translit/backports/init.py -> build/lib.linux-x86_64-2.7/translit/backports copying build/py2k/translit/backports/functools.py -> build/lib.linux-x86_64-2.7/translit/backports creating build/lib.linux-x86_64-2.7/translit/unidecode copying build/py2k/translit/unidecode/test.py -> build/lib.linux-x86_64-2.7/translit/unidecode copying build/py2k/translit/unidecode/init.py -> build/lib.linux-x86_64-2.7/translit/unidecode copying build/py2k/translit/unidecode/unidecode.py -> build/lib.linux-x86_64-2.7/translit/unidecode copying build/py2k/translit/unidecode/setup.py -> build/lib.linux-x86_64-2.7/translit/unidecode copying build/py2k/translit/unidecode/generate_table_h.py -> build/lib.linux-x86_64-2.7/translit/unidecode creating build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x12.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x3a.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x19.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x0d.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x06.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x0a.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/init.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x0b.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x18.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x10.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x1f.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x04.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x0e.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x01.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x00.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x0f.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x11.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x15.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x0c.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x13.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x1a.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x14.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x17.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x05.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x16.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x02.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x09.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables copying build/py2k/translit/unidecode/tables/0x03.py -> build/lib.linux-x86_64-2.7/translit/unidecode/tables creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/translit copying build/lib.linux-x86_64-2.7/translit/spell.py -> build/bdist.linux-x86_64/egg/translit copying build/lib.linux-x86_64-2.7/translit/iconv.py -> build/bdist.linux-x86_64/egg/translit copying build/lib.linux-x86_64-2.7/translit/init.py -> build/bdist.linux-x86_64/egg/translit copying build/lib.linux-x86_64-2.7/translit/downgrade.py -> build/bdist.linux-x86_64/egg/translit copying build/lib.linux-x86_64-2.7/translit/upgrade.py -> build/bdist.linux-x86_64/egg/translit copying build/lib.linux-x86_64-2.7/translit/codec.py -> build/bdist.linux-x86_64/egg/translit creating build/bdist.linux-x86_64/egg/translit/unidecode creating build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x12.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x3a.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x19.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x0d.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x06.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x0a.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/init.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x0b.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x18.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x10.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x1f.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x04.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x0e.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x01.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x00.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x0f.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x11.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x15.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x0c.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x13.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x1a.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x14.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x17.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x05.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x16.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x02.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x09.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/tables/0x03.py -> build/bdist.linux-x86_64/egg/translit/unidecode/tables copying build/lib.linux-x86_64-2.7/translit/unidecode/test.py -> build/bdist.linux-x86_64/egg/translit/unidecode copying build/lib.linux-x86_64-2.7/translit/unidecode/init.py -> build/bdist.linux-x86_64/egg/translit/unidecode copying build/lib.linux-x86_64-2.7/translit/unidecode/unidecode.py -> build/bdist.linux-x86_64/egg/translit/unidecode copying build/lib.linux-x86_64-2.7/translit/unidecode/setup.py -> build/bdist.linux-x86_64/egg/translit/unidecode copying build/lib.linux-x86_64-2.7/translit/unidecode/generate_table_h.py -> build/bdist.linux-x86_64/egg/translit/unidecode creating build/bdist.linux-x86_64/egg/translit/backports copying build/lib.linux-x86_64-2.7/translit/backports/init.py -> build/bdist.linux-x86_64/egg/translit/backports copying build/lib.linux-x86_64-2.7/translit/backports/functools.py -> build/bdist.linux-x86_64/egg/translit/backports byte-compiling build/bdist.linux-x86_64/egg/translit/spell.py to spell.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/iconv.py to iconv.pyc SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/translit/iconv.py', 93, 14, 'def iconv(buf: bytes, to_code=DEFAULT_TO_CODE, to_suffix=None,\n'))

byte-compiling build/bdist.linux-x86_64/egg/translit/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/downgrade.py to downgrade.pyc SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/translit/downgrade.py', 46, 19, 'def downgrade(text: str, encoding=DEFAULT_ENCODING) -> str:\n'))

byte-compiling build/bdist.linux-x86_64/egg/translit/upgrade.py to upgrade.pyc SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/translit/upgrade.py', 63, 18, 'def _upgrade(text: str, language=None) -> str:\n'))

byte-compiling build/bdist.linux-x86_64/egg/translit/codec.py to codec.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x12.py to 0x12.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x3a.py to 0x3a.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x19.py to 0x19.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x0d.py to 0x0d.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x06.py to 0x06.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x0a.py to 0x0a.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x0b.py to 0x0b.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x18.py to 0x18.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x10.py to 0x10.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x1f.py to 0x1f.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x04.py to 0x04.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x0e.py to 0x0e.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x01.py to 0x01.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x00.py to 0x00.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x0f.py to 0x0f.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x11.py to 0x11.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x15.py to 0x15.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x0c.py to 0x0c.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x13.py to 0x13.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x1a.py to 0x1a.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x14.py to 0x14.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x17.py to 0x17.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x05.py to 0x05.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x16.py to 0x16.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x02.py to 0x02.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x09.py to 0x09.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/tables/0x03.py to 0x03.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/test.py to test.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/unidecode.py to unidecode.pyc SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/translit/unidecode/unidecode.py', 14, 19, 'def unidecode(text: str) -> str:\n'))

byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/setup.py to setup.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/unidecode/generate_table_h.py to generate_table_h.pyc SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/translit/unidecode/generate_table_h.py', 32, 46, ' print("const char *TABLE[] = {", file=f)\n'))

byte-compiling build/bdist.linux-x86_64/egg/translit/backports/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/translit/backports/functools.py to functools.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... translit.unidecode.test: module references file creating dist creating 'dist/translit-0.2a1-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing translit-0.2a1-py2.7.egg creating /usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg Extracting translit-0.2a1-py2.7.egg to /usr/local/lib/python2.7/dist-packages SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg/translit/iconv.py', 93, 14, 'def iconv(buf: bytes, to_code=DEFAULT_TO_CODE, to_suffix=None,\n'))

SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg/translit/downgrade.py', 46, 19, 'def downgrade(text: str, encoding=DEFAULT_ENCODING) -> str:\n'))

SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg/translit/upgrade.py', 63, 18, 'def _upgrade(text: str, language=None) -> str:\n'))

SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg/translit/unidecode/unidecode.py', 14, 19, 'def unidecode(text: str) -> str:\n'))

SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg/translit/unidecode/generate_table_h.py', 32, 46, ' print("const char *TABLE[] = {", file=f)\n'))

Adding translit 0.2a1 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/translit-0.2a1-py2.7.egg Processing dependencies for translit==0.2a1 Finished processing dependencies for translit==0.2a1

com:~/downloads/translit-0.2a1$ python Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import translit Traceback (most recent call last): File "<stdin>", line 1, in <module> File "translit/init.py", line 6 SyntaxError: Non-ASCII character '\xc2' in file translit/init.py on line 7, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Comments (3)

  1. spirit repo owner

    It looks as though it was the Python 3 version you tried to import. Try going to another directory first:

    cd
    python
    

    The syntax errors during the build process are odd, though. There might be another issue here.

    By the way, you should probably use virtualenv when trying out a package.

  2. spirit repo owner

    Tested on Ubuntu 12.04, and it works for me:

    wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py && python2 virtualenv.py ENV && . ENV/bin/activate
    pip install https://bitbucket.org/spirit/translit/get/tip.zip
    python2
    
    >>> import translit
    >>> u"déjà-vu".encode("ascii/translit")
    'deja-vu'
    

    If you want to use v0.2a1 instead, you need to install 3to2 first:

    pip install pyenchant 3to2
    wget https://bitbucket.org/spirit/translit/downloads/translit-0.2a1.tar.bz2
    tar -xvf translit-0.2a1.tar.bz2
    cd translit-0.2a1
    python2 setup.py install
    cd .. # This is important
    python2
    
  3. Log in to comment