I work offline from remote location about 2000m above the sea level. There
is no internet connection here, so I can not use tracker online. I need a
Python editor here, and I have Spyder checkout. The problem is that my
installation has only Python3. I've tried using 2to3 from setup.py
(attached), but it fails when I execute:

$ sudo python3 setup.py install

stderr.log and stdout.log are attached. Is it the intended behavior?
It is also hard find "Porting Python 2 Code to Python 3" article, because
it is not referenced from "Porting to Python 3.x" chapters.



-- 
-- 
anatoly t.
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)

"""
Spyder
======

The Scientific PYthon Development EnviRonment
"""

from distutils.core import setup
from distutils.command.build import build
try: # Python 3
  from distutils.command.build_py import build_py_2to3 as build_py
except ImportError: # Python 2
  from distutils.command.build_py import build_py

import os
import os.path as osp
import sys

try:
    from sphinx import setup_command as sphinx_setup_command
except ImportError:
    sphinx_setup_command = False
    sys.stderr.write("Sphinx not installed. Documentation won't be built.\n")


def get_package_data(name, extlist):
    """Return data files for package *name* with extensions in *extlist*"""
    flist = []
    # Workaround to replace os.path.relpath (not available until Python 2.6):
    offset = len(name)+len(os.pathsep)
    for dirpath, _dirnames, filenames in os.walk(name):
        for fname in filenames:
            if not fname.startswith('.') and osp.splitext(fname)[1] in extlist:
                flist.append(osp.join(dirpath, fname)[offset:])
    return flist


def get_subpackages(name):
    """Return subpackages of package *name*"""
    splist = []
    for dirpath, _dirnames, _filenames in os.walk(name):
        if osp.isfile(osp.join(dirpath, '__init__.py')):
            splist.append(".".join(dirpath.split(os.sep)))
    return splist


# for 2to3
cmdclass = {'build_py':build_py}

# Sphinx build (documentation)
if sphinx_setup_command:
    class MyBuild(build):
        def has_doc(self):
            setup_dir = os.path.dirname(os.path.abspath(__file__))
            return os.path.isdir(os.path.join(setup_dir, 'doc'))
        sub_commands = build.sub_commands + [('build_doc', has_doc)]


    class MyBuildDoc(sphinx_setup_command.BuildDoc):
        def run(self):
            build = self.get_finalized_command('build')
            sys.path.insert(0, os.path.abspath(build.build_lib))
            dirname = self.distribution.get_command_obj('build').build_purelib
            self.builder_target_dir = osp.join(dirname, 'spyderlib', 'doc')
            try:
                setup_command.BuildDoc.run(self)
            except UnicodeDecodeError:
                sys.stderr.write(   "ERROR: unable to build documentation "\
                                "because Sphinx do not handle source path "\
                                "with non-ASCII characters. Please try to "\
                                "move the source package to another location "\
                                "(path with *only* ASCII characters).\n")
            sys.path.pop(0)

    cmdclass.update( {'build': MyBuild, 'build_doc': MyBuildDoc} )


NAME = 'spyder'
LIBNAME = 'spyderlib'
from spyderlib import __version__, __project_url__


def get_packages():
    """Return package list"""
    packages = get_subpackages(LIBNAME)+get_subpackages('spyderplugins')
    if os.name == 'nt':
        # Adding pyflakes and rope to the package if available in the 
        # repository (this is not conventional but Spyder really need 
        # those tools and there is not decent package manager on 
        # Windows platforms, so...)
        for name in ('rope', 'pyflakes'):
            if osp.isdir(name):
                packages += get_subpackages(name)
    return packages
    

setup(name=NAME,
      version=__version__,
      description='Scientific PYthon Development EnviRonment',
      long_description=\
"""The spyderlib library includes Spyder, a free open-source Python 
development environment providing MATLAB-like features in a simple 
and light-weighted software.
It also provides ready-to-use pure-Python widgets to your PyQt4 or 
PySide application: source code editor with syntax highlighting and 
code introspection/analysis features, NumPy array editor, dictionary 
editor, Python console, etc.""",
      download_url='%s/files/%s-%s.zip' % (__project_url__, NAME, __version__),
      author="Pierre Raybaut",
      url=__project_url__,
      license='MIT',
      keywords='PyQt4 PySide editor shell console widgets IDE',
      platforms=['any'],
      packages=get_packages(),
      package_data={LIBNAME:
                    get_package_data(LIBNAME, ('.mo', '.svg', '.png', '.css',
                                               '.html', '.js')),
                    'spyderplugins':
                    get_package_data('spyderplugins',
                                     ('.mo', '.svg', '.png'))},
      requires=["rope (>=0.9.2)", "sphinx (>=0.6.0)", "PyQt4 (>=4.4)"],
      scripts=[osp.join('scripts', fname) for fname in 
               (['spyder', 'spyder.bat', "%s_win_post_install.py" % NAME,
                 'spyder.ico', 'spyder_light.ico']
                if os.name == 'nt' else ['spyder'])],
      options={"bdist_wininst":
               {"install_script": "%s_win_post_install.py" % NAME,
                "title": "%s-%s" % (NAME, __version__),
                "user_access_control": "auto"},
               "bdist_msi":
               {"install_script": "%s_win_post_install.py" % NAME}},
      classifiers=['License :: OSI Approved :: MIT License',
                   'Operating System :: MacOS',
                   'Operating System :: Microsoft :: Windows',
                   'Operating System :: OS Independent',
                   'Operating System :: POSIX',
                   'Operating System :: Unix',
                   'Programming Language :: Python :: 2.5',
                   'Programming Language :: Python :: 2.6',
                   'Programming Language :: Python :: 2.7',
                   'Development Status :: 5 - Production/Stable',
                   'Topic :: Scientific/Engineering',
                   'Topic :: Software Development :: Widget Sets'],
      cmdclass=cmdclass)
Sphinx not installed. Documentation won't be built.
  File "/usr/lib/python3.2/site-packages/spyderlib/utils/inspector/conf.py", line 51
    project = u"Object Inspector"
                                ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/external/pickleshare.py", line 87
    except OSError,e:
                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/external/path.py", line 587
    return (t.replace(u'\r\n', u'\n')
                            ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/bsdsocket.py", line 112
    print "-- Testing standard Python socket interface --"
                                                         ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/vcs.py", line 99
    print get_vcs_root(osp.dirname(__file__))
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/codeanalysis.py", line 47
    except SyntaxError, value:
                      ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/dochelpers.py", line 238
    def method(self, x, y=2, (u, v, w)=(None, 0, 0)):
                             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/module_completion.py", line 44
    print "Module list generation is taking too long, we give up."
                                                                 ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/misc.py", line 59
    except socket.error, _msg:  # analysis:ignore
                       ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/iofuncs.py", line 48
    except Exception, error:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/utils/programs.py", line 222
    print find_program('hg')
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/plugins/shortcuts.py", line 369
    print [str(s) for s in table.model.shortcuts]
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/plugins/inspector.py", line 720
    except Exception, error:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/monitor.py", line 456
    except Exception, error:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/systemshell.py", line 86
    self.send_to_process("""PS1="\u@\h:\w> "\n""")
                                    ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 5-7: truncated \uXXXX escape

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/namespacebrowser.py", line 469
    except Exception, error:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 160
    print "The argument must be either a string or a module object"
                                                                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/texteditor.py", line 87
    print "Accepted:", text
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/projectexplorer.py", line 708
    except EnvironmentError, error:
                           ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/sourcecode/mixins.py", line 253
    while text.endswith(u"\u2029"):
                                ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/sourcecode/syntaxhighlighters.py", line 796
    print "Error matching '%s' as outline comment" % line
                                                 ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/sourcecode/codeeditor.py", line 125
    except Exception, _error:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/dicteditorutils.py", line 74
    print value, "-->", v
              ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/findinfiles.py", line 258
    except IOError, (_errno, _strerror):
                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/explorer.py", line 456
    except EnvironmentError, error:
                           ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/figureoptions.py", line 133
    markers = sorted(MARKERS.items(), key=lambda (k,v): (v,k))
                                                 ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/arrayeditor.py", line 216
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/pathmanager.py", line 244
    print test.get_path_list()
             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/importwizard.py", line 223
    return u"\t"
               ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/editor.py", line 1050
    text = u"%s — %s"
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/formlayout.py", line 233
    print "\n"+("*"*80)
             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/dicteditor.py", line 355
    except Exception, msg:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/objecteditor.py", line 153
    print oedit(foobar)
              ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/internalshell.py", line 323
    self.insert_text(u"\n<Δt>=%dms\n" % (1e2*(time()-t0)))
                                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/widgets/shell.py", line 257
    except EnvironmentError, error:
                           ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderlib/qt/compat.py", line 201
    print repr(getexistingdirectory())
             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderplugins/io_hdf5.py", line 56
    except Exception, error:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.2/site-packages/spyderplugins/io_dicom.py", line 12
    except Exception, error:
                    ^
SyntaxError: invalid syntax

running install
running build
running build_py
running build_scripts
running install_lib
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/inspector/conf.py to conf.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/external/pickleshare.py to pickleshare.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/external/path.py to path.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/bsdsocket.py to bsdsocket.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/vcs.py to vcs.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/codeanalysis.py to codeanalysis.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/dochelpers.py to dochelpers.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/module_completion.py to module_completion.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/misc.py to misc.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/iofuncs.py to iofuncs.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/utils/programs.py to programs.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/plugins/shortcuts.py to shortcuts.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/plugins/inspector.py to inspector.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/monitor.py to monitor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/systemshell.py to systemshell.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/namespacebrowser.py to namespacebrowser.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/externalshell/sitecustomize.py to sitecustomize.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/texteditor.py to texteditor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/projectexplorer.py to projectexplorer.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/sourcecode/mixins.py to mixins.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/sourcecode/syntaxhighlighters.py to syntaxhighlighters.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/sourcecode/codeeditor.py to codeeditor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/dicteditorutils.py to dicteditorutils.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/findinfiles.py to findinfiles.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/explorer.py to explorer.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/figureoptions.py to figureoptions.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/arrayeditor.py to arrayeditor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/pathmanager.py to pathmanager.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/importwizard.py to importwizard.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/editor.py to editor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/formlayout.py to formlayout.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/dicteditor.py to dicteditor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/objecteditor.py to objecteditor.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/internalshell.py to internalshell.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/widgets/shell.py to shell.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderlib/qt/compat.py to compat.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderplugins/io_hdf5.py to io_hdf5.cpython-32.pyc
byte-compiling /usr/lib/python3.2/site-packages/spyderplugins/io_dicom.py to io_dicom.cpython-32.pyc
running install_scripts
changing mode of /usr/bin/spyder to 755
running install_egg_info
Removing /usr/lib/python3.2/site-packages/spyder-2.2.0dev-py3.2.egg-info
Writing /usr/lib/python3.2/site-packages/spyder-2.2.0dev-py3.2.egg-info
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to