Skip to content

AttributeError: 'spawn' object has no attribute 'ptyproc' #2

@lstagner

Description

@lstagner

This issue was sent to me by email.

I am trying to download your IPython IDL kernel, running into the following error message in the command line after running:

rgntgw1-0-232-dhcp:~ benjamingerard$ ipython console --kernel IDL
IPython Console 3.1.0
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/Applications/Ureka/python/lib/python2.7/runpy.pyc in _run_module_as_main(mod_name='idl_kernel', alter_argv=1)
    160         sys.argv[0] = fname
    161     return _run_code(code, main_globals, None,
--> 162                      "__main__", fname, loader, pkg_name)
        fname = '/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py'
        loader = <pkgutil.ImpLoader instance at 0x1007ba950>
        pkg_name = ''
    163
    164 def run_module(mod_name, init_globals=None,

/Applications/Ureka/python/lib/python2.7/runpy.pyc in _run_code(code=<code object <module> at 0x1007bb830, file "/App...b/python2.7/site-packages/idl_kernel.py", line 1>, run_globals={'EOF': <class 'pexpect.exceptions.EOF'>, 'IDLKernel': <class '__main__.IDLKernel'>, 'IPKernelApp': <class 'IPython.kernel.zmq.kernelapp.IPKernelApp'>, 'Kernel': <class 'IPython.kernel.zmq.kernelbase.Kernel'>, '__builtins__': <module '__builtin__' (built-in)>, '__doc__': None, '__file__': '/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py', '__loader__': <pkgutil.ImpLoader instance>, '__name__': '__main__', '__package__': '', ...}, init_globals=None, mod_name='__main__', mod_fname='/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py', mod_loader=<pkgutil.ImpLoader instance>, pkg_name='')
     70                        __loader__ = mod_loader,
     71                        __package__ = pkg_name)
---> 72     exec code in run_globals
        code = <code object <module> at 0x1007bb830, file "/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py", line 1>
        run_globals = {'spawn': <class 'pexpect.pty_spawn.spawn'>, 'EOF': <class 'pexpect.exceptions.EOF'>, 'b64encode': <function b64encode at 0x101e37f50>, '__loader__': <pkgutil.ImpLoader instance at 0x1007ba950>, 'version_pat': <_sre.SRE_Pattern object at 0x1030ec9c0>, 're': <module 're' from '/Applications/Ureka/variants/common/lib/python2.7/re.pyc'>, 'tempfile': <module 'tempfile' from '/Applications/Ureka/python/lib/python2.7/tempfile.pyc'>, '__package__': '', 'publish_display_data': <function publish_display_data at 0x101ebd5f0>, '__version__': '0.4', '__file__': '/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py', 'find_executable': <function find_executable at 0x1032865f0>, '__builtins__': <module '__builtin__' (built-in)>, 'glob': <function glob at 0x101c43c80>, 'rmtree': <function rmtree at 0x101b5ac80>, '__name__': '__main__', 'replwrap': <module 'pexpect.replwrap' from '/Applications/Ureka/variants/common/lib/python2.7/site-packages/pexpect/replwrap.pyc'>, 'Kernel': <class 'IPython.kernel.zmq.kernelbase.Kernel'>, 'locate_profile': <function locate_profile at 0x101cf00c8>, 'IDLKernel': <class '__main__.IDLKernel'>, 'signal': <module 'signal' (built-in)>, '__doc__': None, 'check_output': <function check_output at 0x101cbfb90>, 'IPKernelApp': <class 'IPython.kernel.zmq.kernelapp.IPKernelApp'>, 'os': <module 'os' from '/Applications/Ureka/variants/common/lib/python2.7/os.pyc'>}
     73     return run_globals
     74

/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py in <module>()
    227 if __name__ == '__main__':
    228     from IPython.kernel.zmq.kernelapp import IPKernelApp
--> 229     IPKernelApp.launch_instance(kernel_class=IDLKernel)
        global IPKernelApp.launch_instance = <bound method MetaHasTraits.launch_instance of <class 'IPython.kernel.zmq.kernelapp.IPKernelApp'>>
        global kernel_class = undefined
        global IDLKernel = <class '__main__.IDLKernel'>

/Applications/Ureka/variants/common/lib/python2.7/site-packages/IPython/config/application.pyc in launch_instance(cls=<class 'IPython.kernel.zmq.kernelapp.IPKernelApp'>, argv=None, **kwargs={'kernel_class': <class '__main__.IDLKernel'>})
    571         """
    572         app = cls.instance(**kwargs)
--> 573         app.initialize(argv)
        app.initialize = <bound method IPKernelApp.initialize of <IPython.kernel.zmq.kernelapp.IPKernelApp object at 0x1036fcd90>>
        argv = None
    574         app.start()
    575

/Applications/Ureka/variants/common/lib/python2.7/site-packages/IPython/kernel/zmq/kernelapp.pyc in initialize(self=<IPython.kernel.zmq.kernelapp.IPKernelApp object>, argv=None)

/Applications/Ureka/variants/common/lib/python2.7/site-packages/IPython/config/application.pyc in catch_config_error(method=<function initialize>, app=<IPython.kernel.zmq.kernelapp.IPKernelApp object>, *args=(None,), **kwargs={})
     73     """
     74     try:
---> 75         return method(app, *args, **kwargs)
        method = <function initialize at 0x103703050>
        app = <IPython.kernel.zmq.kernelapp.IPKernelApp object at 0x1036fcd90>
        args = (None,)
        kwargs = {}
     76     except (TraitError, ArgumentError) as e:
     77         app.print_help()

/Applications/Ureka/variants/common/lib/python2.7/site-packages/IPython/kernel/zmq/kernelapp.pyc in initialize(self=<IPython.kernel.zmq.kernelapp.IPKernelApp object>, argv=None)
    353         self.init_io()
    354         self.init_signal()
--> 355         self.init_kernel()
        self.init_kernel = <bound method IPKernelApp.init_kernel of <IPython.kernel.zmq.kernelapp.IPKernelApp object at 0x1036fcd90>>
    356         # shell init steps
    357         self.init_path()

/Applications/Ureka/variants/common/lib/python2.7/site-packages/IPython/kernel/zmq/kernelapp.pyc in init_kernel(self=<IPython.kernel.zmq.kernelapp.IPKernelApp object>)
    308                                 log=self.log,
    309                                 profile_dir=self.profile_dir,
--> 310                                 user_ns=self.user_ns,
        global user_ns = undefined
        self.user_ns = None
    311         )
    312         kernel.record_ports(self.ports)

/Applications/Ureka/variants/common/lib/python2.7/site-packages/IPython/config/configurable.pyc in instance(cls=<class '__main__.IDLKernel'>, *args=(), **kwargs={'iopub_socket': <zmq.sugar.socket.Socket object>, 'log': <logging.Logger object>, 'parent': <IPython.kernel.zmq.kernelapp.IPKernelApp object>, 'profile_dir': <IPython.core.profiledir.ProfileDir object>, 'session': <IPython.kernel.zmq.session.Session object>, 'shell_streams': [<zmq.eventloop.zmqstream.ZMQStream object>, <zmq.eventloop.zmqstream.ZMQStream object>], 'stdin_socket': <zmq.sugar.socket.Socket object>, 'user_ns': None})
    335         # Create and save the instance
    336         if cls._instance is None:
--> 337             inst = cls(*args, **kwargs)
        inst = undefined
        cls = <class '__main__.IDLKernel'>
        args = ()
        kwargs = {'log': <logging.Logger object at 0x103709310>, 'parent': <IPython.kernel.zmq.kernelapp.IPKernelApp object at 0x1036fcd90>, 'shell_streams': [<zmq.eventloop.zmqstream.ZMQStream object at 0x10374c310>, <zmq.eventloop.zmqstream.ZMQStream object at 0x10374c590>], 'user_ns': None, 'iopub_socket': <zmq.sugar.socket.Socket object at 0x103732d50>, 'profile_dir': <IPython.core.profiledir.ProfileDir object at 0x1037094d0>, 'session': <IPython.kernel.zmq.session.Session object at 0x10373ca90>, 'stdin_socket': <zmq.sugar.socket.Socket object at 0x103732db8>}
    338             # Now make sure that the instance will also be returned by
    339             # parent classes' _instance attribute.

/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py in __init__(self=<__main__.IDLKernel object>, **kwargs={'iopub_socket': <zmq.sugar.socket.Socket object>, 'log': <logging.Logger object>, 'parent': <IPython.kernel.zmq.kernelapp.IPKernelApp object>, 'profile_dir': <IPython.core.profiledir.ProfileDir object>, 'session': <IPython.kernel.zmq.session.Session object>, 'shell_streams': [<zmq.eventloop.zmqstream.ZMQStream object>, <zmq.eventloop.zmqstream.ZMQStream object>], 'stdin_socket': <zmq.sugar.socket.Socket object>, 'user_ns': None})
     51     def __init__(self, **kwargs):
     52         Kernel.__init__(self, **kwargs)
---> 53         self._start_idl()
        self._start_idl = <bound method IDLKernel._start_idl of <__main__.IDLKernel object at 0x10374c6d0>>
     54
     55         try:

/Applications/Ureka/variants/common/lib/python2.7/site-packages/idl_kernel.py in _start_idl(self=<__main__.IDLKernel object>)
     75             self._executable = find_executable("gdl")
     76             self._child  = spawn(self._executable,timeout = 300)
---> 77             self.idlwrapper = replwrap.REPLWrapper(self._child,u"GDL> ",None)
        self.idlwrapper = undefined
        global replwrap.REPLWrapper = <class 'pexpect.replwrap.REPLWrapper'>
        self._child = <pexpect.pty_spawn.spawn object at 0x10374c8d0>
        global None = undefined
     78         finally:
     79             signal.signal(signal.SIGINT, sig)

/Applications/Ureka/variants/common/lib/python2.7/site-packages/pexpect/replwrap.pyc in __init__(self=<pexpect.replwrap.REPLWrapper object>, cmd_or_spawn=<pexpect.pty_spawn.spawn object>, orig_prompt=u'GDL> ', prompt_change=None, new_prompt=u'[PEXPECT_PROMPT>', continuation_prompt=u'[PEXPECT_PROMPT+', extra_init_cmd=None)
     45             # Existing spawn instance has echo enabled, disable it
     46             # to prevent our input from being repeated to output.
---> 47             self.child.setecho(False)
        self.child.setecho = <bound method spawn.setecho of <pexpect.pty_spawn.spawn object at 0x10374c8d0>>
        global False = undefined
     48             self.child.waitnoecho()
     49

/Applications/Ureka/variants/common/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in setecho(self=<pexpect.pty_spawn.spawn object>, state=False)
    381         Not supported on platforms where ``isatty()`` returns False.
    382         '''
--> 383         return self.ptyproc.setecho(state)
        self.ptyproc.setecho = undefined
        state = False
    384
    385         self.echo = state

AttributeError: 'spawn' object has no attribute 'ptyproc'

can you help me fix this or direct me to someone who can?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions