translate / virtaal

Easy-to-use and powerful offline translation tool

Home Page:https://virtaal.translatehouse.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Virtaal can't run, have syntax error when running ./virtaal on ArchLinux

dylan-dinh opened this issue · comments

SyntaxError: Missing parentheses in call to 'print'. Did you mean print('DEPENDENCY WARNINGS:')?

When I'm running ./virtaal ?

Anyone has a tip ?

Hello. How did you installed Virtaal (AUR package, compiled yourself, etc.) ? And what version are you trying?

Sounds like this is a Python 2.x and 3.x compatibility issue. The code doing the "print" isn't compatible with Python 3.

Well, I was expecting a reply from the OP, but here's some info:

print 'text' is a Python 2 syntax, and print('text') is Python 3. Since Virtaal is implemented in Python 2, it is expected that building/running with Python 3 a SyntaxError expection is raised. Since Arch Linux's binary python is for Python 3 and python2 is Python 2, it is very common to get this type of error when not using the correct binary name.

Just like any other python2-based app, building Virtaal in Arch Linux requires:

  1. Replacing any occurrence /usr/bin/python with its /usr/bin/python2 and /usr/bin/env python with /usr/bin/env python2 in the source code
  2. Building Virtaal with python2, not python

Consider checking the Virtaal package's PKGBUILD in AUR for such instructions.

Alternatively, consider trying Virtaal's py3 branch for the experimental Python 3 implementation.