winpython / winpython

A free Python-distribution for Windows platform, including prebuilt packages for Scientific Python.
https://winpython.github.io/
MIT License
1.8k stars 300 forks source link

Module for pyQT iPython seems missing #306

Closed RobBaer closed 8 years ago

RobBaer commented 8 years ago

Steps to reproduce: Start a program (makeHuman) that tries to create an pyQT iPython shell, and there seems a possible library problem with my 64-bit WinPython. The developer suggested sharing the exception here.

The reported exception is this:

 Traceback (most recent call last):
  File "./core\mhmain.py", line 541, in loadPlugin
    module.load(self)
  File "plugins/7_shell.py", line 226, in load
    taskview = category.addTask(ShellTaskView(category))
  File "plugins/7_shell.py", line 67, in __init__
    self.console = self.addTopWidget(ipythonconsole.IPythonConsoleWidget())
  File "./lib\ipythonconsole.py", line 131, in __init__
    self.ipyConsole = _QIPythonWidget(customBanner="Welcome to MakeHuman the embedded ipython console\n")
  File "./lib\ipythonconsole.py", line 80, in __init__
    kernel_client.start_channels()
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\qt\kernel_mixins.py", line 43, in start_channels
    super(QtKernelClientMixin, self).start_channels(*args, **kw)
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\kernel\inprocess\client.py", line 54, in start_channels
    super(InProcessKernelClient, self).start_channels(self)
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\kernel\client.py", line 105, in start_channels
    self.kernel_info()
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\kernel\inprocess\client.py", line 127, in kernel_info
    self._dispatch_to_kernel(msg)
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\kernel\inprocess\client.py", line 144, in _dispatch_to_kernel
    self.session.send(stream, msg)
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\kernel\zmq\session.py", line 664, in send
    stream.send_multipart(to_send, copy=copy)
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\IPython\kernel\inprocess\socket.py", line 62, in send_multipart
    self.queue.put_nowait(msg_parts)
AttributeError: 'Queue' object has no attribute 'put_nowait'
stonebig commented 8 years ago

I would suggest you switch and try with a more recent, Python3 based, WinPython3.4.4.1 release. "MakeHuman" is going that way too: https://bitbucket.org/MakeHuman/makehuman/commits/dabf1097ba6daf5d47fa1d8b353e33b27b08861e

You may also try posting your issue on StackOverflow.

duststorm commented 8 years ago

MakeHuman has no plans to move to python 3 any time soon.

This bug can actually be described a lot simpler: WinPython has a bug in the python 2 Queue API: For some reason, the function "Queue.put_nowait" fell off. I can't find any reason why it should not be there: https://hg.python.org/cpython/file/2.7/Lib/Queue.py#l142 https://docs.python.org/2/library/queue.html#Queue.Queue.put_nowait

Alternatively I could report that module IPython\kernel\inprocess\socket.py that comes with WinPython (python 2) contains a bug: it uses Queue.put_nowait but that function is not available.

I think either this function should be added (which would be the best solution because the API doc says the function exists), or all uses of the function within the WinPython distribution should be replaced with "put(item, False)".

stonebig commented 8 years ago

Sorry to learn that "MakeHuman" has no imminent plan for Python3.

WinPython, like some bigger projects and companies, has to focus to remain relevant, and Python 2.7 was becoming more and more painfull to maintain as Python stack and Windows were going forward.

stonebig commented 8 years ago

We can't help, until MakeHuman is Python3 compatible.