How to get a Python 2.7 package (Spynner) to work with Python 3?
<p>The Spynner docs says it supports Python >=26, but during installation I get the following error:</p>

<pre><code>(spynner) spynner$ pip3 install spynner
Requirement already satisfied (use --upgrade to upgrade): spynner in /Users/spynner/Envs/spynner/lib/python3.4/site-packages/spynner-2.19-py3.4.egg
Collecting six (from spynner)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting beautifulsoup4 (from spynner)
  Using cached beautifulsoup4-4.5.1-py3-none-any.whl
Collecting unittest2 (from spynner)
  Using cached unittest2-1.1.0-py2.py3-none-any.whl
Collecting pyquery (from spynner)
  Using cached pyquery-1.2.13.tar.gz
Collecting autopy (from spynner)
  Using cached autopy-0.51.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "&lt;string&gt;", line 1, in &lt;module&gt;
      File "/private/var/folders/zl/dpw1svbx2qjbl549qvzq2r640000gn/T/pip-build-3rvrid_c/autopy/setup.py", line 50
        print 'Updating __init__.py'
                               ^
    SyntaxError: Missing parentheses in call to 'print'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/zl/dpw1svbx2qjbl549qvzq2r640000gn/T/pip-build-3rvrid_c/autopy/
</code></pre>

<p>So it looks like one of the packages is written for 2.7.</p>

<p>Is there some Python trick I can do to get this to work with Python 3, or do I have to go and manually correct the offending code?</p>

<p>Cheers</p>

<p>You will need to correct the offending code. There are automated tools that help you do that, such as <a href="https://docs.python.org/2/library/2to3.html" rel="nofollow">2to3</a>:</p>

<blockquote>
  <p>2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code. The standard library contains a rich set of fixers that will handle almost all code. 2to3 supporting library lib2to3 is, however, a flexible and generic library, so it is possible to write your own fixers for 2to3. lib2to3 could also be adapted to custom applications in which Python code needs to be edited automatically.</p>
</blockquote>

python spynner