Search code examples
pythonpython-3.xdistutilsdistutils2

distutils byte-compiling error in python 2


I have a package that can be installed in python 3 using a distutils based setup.py with the command

python setup.py install

but gives a SyntaxError in python 2. Is there a way to skip the byte-compilation of this particular module or try to catch the SyntaxError exception (using try/except pass did not work)? I would like to have the package installed in python 2 and it does not matter that this module in the package will not work.

byte-compiling ../
    a, b, *c = d
SyntaxError: invalid syntax

Solution

  • The temporary solution was to skip writing of bytecode files with the -B option.

    python -B setup.py install