I have Python 3.6rc1 installed from the official "pkg" bundle for Mac OS. Now, every time I'm using a "debug" run configuration in PyCharm (does not depend on a particular script), I'm getting a huge stack trace with the following error messages (thrown multiple times in a row):
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_signature.py", line 88, in create_signature
filename, modulename, funcname = self.file_module_function_of(frame)
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_signature.py", line 102, in file_module_function_of
modulename = trace.modname(filename)
AttributeError: module 'trace' has no attribute 'modname'
Using the currently latest PyCharm 2016.3. Note that I can debug using Python 2.7 or 3.5 using the same PyCharm instance without any problems.
Has anyone experienced anything like this? Is there a workaround?
Posting on SO since I'm not completely sure this is actually a bug or I've misconfigured something; plus, I know that PyCharm team checks the pycharm
tag here; and, it would be easier for others to find this topic here as opposed to on the PyCharm's bug tracker.
Faced the same issue and even tried different PyCharm versions without success. In the end the reason for debugging console not working was that somewhere in the repo sys. out and sys. stderr were being overwritten.
Press the Autoscroll to Trace toggle button on the toolbar. After that, on clicking a node in the Events pane, PyCharm shows its call stack in the Event Stack pane aqnd opens the corresponding trace file in the editor.
From the main menu, select Run | Debugging Actions | Force Run to Cursor or press Ctrl+Alt+F9 .
There is actually a bug in the PyCharm's PyDev.Debugger
, it uses the trace.modname
which does not exist since Python 3.2:
def file_module_function_of(self, frame): #this code is take from trace module and fixed to work with new-style classes
code = frame.f_code
filename = code.co_filename
if filename:
modulename = trace.modname(filename) # < HERE
else:
modulename = None
# ...
Now, this particular code would only be executed if the debugger is started with the --save-signatures
command-line option which is enabled by the "Collect run-time types information for code insight" Python debugger setting:
Turn the setting off and the error would go away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With