Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with debugfile() in version >= 3.3.0 #8776

Closed
1 task
marianux opened this issue Feb 15, 2019 · 8 comments
Closed
1 task

Problem with debugfile() in version >= 3.3.0 #8776

marianux opened this issue Feb 15, 2019 · 8 comments

Comments

@marianux
Copy link

Issue Report Checklist

  • [ X ] Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ X ] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ X ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ X ] Tried basic troubleshooting (if a bug/error)
    • [ X ] Restarted Spyder
    • [ X ] Reset preferences with spyder --reset
    • [ X ] Reinstalled the latest version of Anaconda
    • [ X ] Tried the other applicable steps from the Troubleshooting Guide
  • [ X ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When updated to version 3.3.3 a problem with ZMQ appeared when trying simple debugging. Not sure if ZMQ produces the problem, but the traceback ends in ZMQ. Further testing indicates that this problem started with version 3.3.0. Version 3.2.8 is ok:

debugfile('/home/mariano/mariano/misc/pytest/qrs_test.py', args='/home/mariano/mariano/dbs/ mitdb', wdir='/home/mariano/mariano/misc/pytest')
Reloaded modules: ipykernel, ipykernel._version, ipykernel.connect, jupyter_client, jupyter_client._version, jupyter_client.connect, zmq, zmq.backend, zmq.backend.select, zmq.backend.cython, zmq.backend.cython.constants, zmq.backend.cython.error, zmq.backend.cython.message, zmq.error, zmq.backend.cython.context, zmq.backend.cython.socket, zmq.backend.cython.utils, zmq.backend.cython._poll, zmq.backend.cython._version, zmq.backend.cython._device, zmq.sugar, zmq.sugar.constants, zmq.utils, zmq.utils.constant_names, zmq.sugar.context, zmq.sugar.attrsettr, zmq.sugar.socket, zmq.sugar.poll, zmq.utils.jsonapi, zmq.utils.strtypes, zmq.sugar.frame, zmq.sugar.tracker, zmq.sugar.version, zmq.sugar.stopwatch, jupyter_client.localinterfaces, jupyter_core, jupyter_core.version, jupyter_core.paths, jupyter_client.launcher, traitlets.log, jupyter_client.client, jupyter_client.channels, jupyter_client.channelsabc, jupyter_client.clientabc, jupyter_client.manager, jupyter_client.kernelspec, jupyter_client.managerabc, jupyter_client.blocking, jupyter_client.blocking.client, jupyter_client.blocking.channels, jupyter_client.multikernelmanager, ipykernel.kernelapp, tornado, tornado.ioloop, tornado.concurrent, tornado.log, tornado.escape, tornado.util, tornado.speedups, tornado.stack_context, mp_main, tornado.platform, tornado.platform.auto, tornado.platform.posix, tornado.platform.common, tornado.platform.interface, zmq.eventloop, zmq.eventloop.ioloop, tornado.platform.asyncio, tornado.gen, zmq.eventloop.zmqstream, ipykernel.iostream, jupyter_client.session, jupyter_client.jsonutil, jupyter_client.adapter, ipykernel.heartbeat, ipykernel.ipkernel, IPython.utils.tokenutil, ipykernel.comm, ipykernel.comm.manager, ipykernel.comm.comm, ipykernel.kernelbase, ipykernel.jsonutil, ipykernel.zmqshell, IPython.core.payloadpage, ipykernel.displayhook, ipykernel.parentpoller, ipykernel.datapub, ipykernel.serialize, ipykernel.pickleutil, ipykernel.codeutil, IPython.core.completerlib, storemagic, autoreload, wurlitzer, kiwisolver, cffi, cffi.api, cffi.lock, cffi.error, cffi.model, ipykernel.pylab, ipykernel.pylab.backend_inline, ipykernel.pylab.config, ipykernel.eventloops, zmq.utils.garbage, spyder, spyder.pil_patch

/home/mariano/mariano/misc/pytest/qrs_test.py(7)()
5
6 @author: mariano
----> 7 """
8
9 # Importo TensorFlow como tf

Traceback (most recent call last):

[ ... omitted here ]

What steps reproduce the problem?

  1. Update to version 3.3.3
  2. issue the command:

debugfile('/home/mariano/mariano/misc/pytest/qrs_test.py', args='/home/mariano/mariano/dbs/ mitdb', wdir='/home/mariano/mariano/misc/pytest')

What is the expected output? What do you see instead?

If downgrade to version 3.2.8 the problem solves automatically with this output:

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
Type "copyright", "credits" or "license" for more information.

IPython 6.5.0 -- An enhanced Interactive Python.

In [1]: debugfile('/home/mariano/mariano/misc/pytest/qrs_test.py', args='/home/mariano/mariano/dbs/ mitdb', wdir='/home/mariano/mariano/misc/pytest')

/home/mariano/mariano/misc/pytest/qrs_test.py(7)()
5
6 @author: mariano
----> 7 """
8
9 # Importo TensorFlow como tf

ipdb>

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE
  File "<ipython-input-1-a818c5fab307>", line 1, in <module>
    debugfile('/home/mariano/mariano/misc/pytest/qrs_test.py', args='/home/mariano/mariano/dbs/ mitdb', wdir='/home/mariano/mariano/misc/pytest')

  File "/home/mariano/.local/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 809, in debugfile
    debugger.run("runfile(%r, args=%r, wdir=%r)" % (filename, args, wdir))

  File "/usr/lib/python3.6/bdb.py", line 434, in run
    exec(cmd, globals, locals)

  File "<string>", line 1, in <module>

  File "/home/mariano/.local/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 786, in runfile
    execfile(filename, namespace)

  File "/home/mariano/.local/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/mariano/mariano/misc/pytest/qrs_test.py", line 7, in <module>
    """

  File "/home/mariano/mariano/misc/pytest/qrs_test.py", line 7, in <module>
    """

  File "/usr/lib/python3.6/bdb.py", line 51, in trace_dispatch
    return self.dispatch_line(frame)

  File "/usr/lib/python3.6/bdb.py", line 69, in dispatch_line
    self.user_line(frame)

  File "/usr/lib/python3.6/pdb.py", line 261, in user_line
    self.interaction(frame, None)

  File "/home/mariano/.local/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 425, in interaction
    self._cmdloop()

  File "/home/mariano/.local/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 436, in _cmdloop
    self.cmdloop()

  File "/usr/lib/python3.6/cmd.py", line 126, in cmdloop
    line = input(self.prompt)

  File "/home/mariano/.local/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 704, in raw_input
    password=False,

  File "/home/mariano/.local/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 714, in _input_request
    self.stdin_socket.recv_multipart(zmq.NOBLOCK)

  File "/home/mariano/.local/lib/python3.6/site-packages/zmq/sugar/socket.py", line 467, in recv_multipart
    parts = [self.recv(flags, copy=copy, track=track)]

  File "zmq/backend/cython/socket.pyx", line 788, in zmq.backend.cython.socket.Socket.recv

  File "zmq/backend/cython/socket.pyx", line 824, in zmq.backend.cython.socket.Socket.recv

  File "zmq/backend/cython/socket.pyx", line 191, in zmq.backend.cython.socket._recv_copy

  File "zmq/backend/cython/socket.pyx", line 186, in zmq.backend.cython.socket._recv_copy

  File "zmq/backend/cython/checkrc.pxd", line 19, in zmq.backend.cython.checkrc._check_rc

Again: Resource temporarily unavailable

Versions

  • Spyder version: 3.3.3
  • Python version: 3.6.7
  • Qt version:
  • PyQt version: 5.9.2
  • Operating System name/version: Ubuntu 18.04

Dependencies

IPython >=4.0     :  6.5.0 (OK)
cython >=0.21     :  None (NOK)
jedi >=0.9.0      :  0.12.1 (OK)
matplotlib >=2.0.0:  3.0.2 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
numpy >=1.7       :  1.16.1 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
psutil >=0.3      :  5.4.6 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pyflakes >=0.6.0  :  2.0.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  2.1.1 (OK)
qtconsole >=4.2.0 :  4.4.0 (OK)
rope >=0.9.4      :  0.11.0 (OK)
sphinx >=0.6.6    :  1.7.6 (OK)
sympy >=0.7.3     :  None (NOK)

qrs_test.py.zip

@ccordoba12
Copy link
Member

Thanks for reporting. We'll take a look at this in our next release.

@ccordoba12
Copy link
Member

I can't reproduce this problem but you can help me to fix it.

Please locate this file in your installation

https://github.com/spyder-ide/spyder-kernels/blob/v0.4.2/spyder_kernels/customize/spydercustomize.py

then go to this line:

https://github.com/spyder-ide/spyder-kernels/blob/v0.4.2/spyder_kernels/customize/spydercustomize.py#L604

and add the second entry that appears below :

patterns = [r'^/usr/lib.*',
            r'^/home/.*/.local/lib.*',
            r'^/usr/local/lib.*',
            r'^/usr/.*/dist-packages/.*',
            r'^/Library/.*'
]

That should fix your problem.

@ccordoba12 ccordoba12 removed this from the v3.3.4 milestone Feb 17, 2019
@ccordoba12 ccordoba12 added this to the v3.3.4 milestone Feb 17, 2019
@marianux
Copy link
Author

marianux commented Feb 18, 2019 via email

@ccordoba12
Copy link
Member

Ok, no problem, thanks for the confirmation! 👍

We'll fix this problem in our next version (3.3.4).

@obbe79
Copy link

obbe79 commented Feb 19, 2019

Having the same exact issue here. But I should probably use a different pattern string to fix the issue, right?

Traceback (most recent call last):

  File "<ipython-input-1-5d58f6a324c7>", line 1, in <module>
    debugfile('C:/Users/myself/Documents/GitHub/python_proj/debugScript.py', wdir='C:/Users/myself/Documents/GitHub/python_proj')

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 810, in debugfile
    debugger.run("runfile(%r, args=%r, wdir=%r)" % (filename, args, wdir))

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\bdb.py", line 434, in run
    exec(cmd, globals, locals)

  File "<string>", line 1, in <module>

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 787, in runfile
    execfile(filename, namespace)

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "c:/users/myself/documents/github/python_proj/debugscript.py", line 6, in <module>
    """

  File "c:/users/myself/documents/github/python_proj/debugscript.py", line 6, in <module>
    """

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\bdb.py", line 51, in trace_dispatch
    return self.dispatch_line(frame)

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\bdb.py", line 69, in dispatch_line
    self.user_line(frame)

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\pdb.py", line 261, in user_line
    self.interaction(frame, None)

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 425, in interaction
    self._cmdloop()

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 436, in _cmdloop
    self.cmdloop()

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\cmd.py", line 126, in cmdloop
    line = input(self.prompt)

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 853, in raw_input
    password=False,

  File "C:\Users\myself\AppData\Local\Continuum\anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 863, in _input_request
    self.stdin_socket.recv_multipart(zmq.NOBLOCK)

  File "C:\Users\myself\AppData\Roaming\Python\Python36\site-packages\zmq\sugar\socket.py", line 467, in recv_multipart
    parts = [self.recv(flags, copy=copy, track=track)]

  File "zmq\backend\cython\socket.pyx", line 792, in zmq.backend.cython.socket.Socket.recv

  File "zmq\backend\cython\socket.pyx", line 828, in zmq.backend.cython.socket.Socket.recv

  File "zmq\backend\cython\socket.pyx", line 193, in zmq.backend.cython.socket._recv_copy

  File "zmq\backend\cython\socket.pyx", line 188, in zmq.backend.cython.socket._recv_copy

  File "zmq\backend\cython\checkrc.pxd", line 19, in zmq.backend.cython.checkrc._check_rc

Again: Resource temporarily unavailable

@danieltomasz
Copy link

danieltomasz commented Feb 19, 2019

I also confirm that it helps with the problem (local pip user installed library)!

@ccordoba12
Copy link
Member

@obbe79, we'll cover the Windows case too when fixing this issue.

@drumfiend2
Copy link

I realize that this is an old, closed issue, but I wanted to follow up on obbe79's question regarding Windows, as I'm currently having the same exact problem and was wondering if there was any resolution since this post. I'm happy to create a new issue post if that's appropriate. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants