Pycharm debugger fails on breakpoints. ('module' object has no attribute 'show')

I've been experimenting problems lately to debug a collaborative project I am working on. The code is written in Python although it include some XML and .xls to import data. When I put a breakpoint and run the debugger I get the following error:

Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pydev\pydevd_frame.py", line 424, in trace_dispatch
self.doWaitSuspend(thread, frame, event, arg)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pydev\pydevd_frame.py", line 56, in doWaitSuspend
self._args[0].doWaitSuspend(*args, **kwargs)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pydev\pydevd.py", line 1448, in doWaitSuspend
activate_function()
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pydev\pydev_ipython\matplotlibtools.py", line 136, in activate_pylab
pylab.show._needmain = False
AttributeError: 'module' object has no attribute 'show'

 

No matter where I put the breakpoint the error always raises. Sometimes the execution is interrupted and some the execution continues ignoring any following breakpoint. 

I tried to use a breakpoint in a hello world code, no error was raised. 

It seems that other users have had the same issue in the last 12 months but I could not find any solution online.  

See case1, case2

6 comments
Comment actions Permalink

Could there be some kind of mal-formed condition set for the breakpoint?

0
Comment actions Permalink

It is a simple breakpoint, no conditions in it. This issue is very annoying I'm dealing with a complex project. I have to use print to debug which take too much time.  

0
Comment actions Permalink

Hi! Are you able to run 

import pylab
pylab.show()

with your Python interpreter?

1
Comment actions Permalink

Thanks Elizabeth, No I can't

Output in Pycharm IPython console:

Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
In[2]: import pylab
Matplotlib support failed
In[3]: pylab.show()
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\IPython\core\interactiveshell.py", line 2883, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-579bf2c28610>", line 1, in <module>
pylab.show()
AttributeError: 'module' object has no attribute 'show'

output in standard python interpreter:

>>> import pylab
>>> pylab.show()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'show'
>>>

0
Comment actions Permalink

What is your matplotlib version? It seems you have a corrupted installation. Are you able to reproduce the bug with another interpreter? 

0
Comment actions Permalink

matplotlib (1.4.2)

pylab (0.1.3)

 

0

Please sign in to leave a comment.