When running debugger I get the error: AttributeError: module 'platform' has no attribute 'python_implementation'

I am running PyCharm 2020.1.2 on Fedora Linux and Python 3.7.

I have successfully used the debugger before on code I write. But when I try to use the debugger in another project written by someone else I get the following error when I try to debug the code:

Traceback (most recent call last):
File "/home/iank/software/pycharm/plugins/python/helpers/pydev/pydevd.py", line 22, in <module>
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PYCHARM, get_thread_id, get_current_thread_id, \
File "/home/iank/software/pycharm-2020.1.2/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py", line 25, in <module>
IS_CPYTHON = platform.python_implementation() == 'CPython'
AttributeError: module 'platform' has no attribute 'python_implementation'

If I pull up the Python console, import platform and enter platform.python_implementation() I get CPython.

Any idea what is causing this error?

Comment actions Permalink


I suggest to find the 'platform' module in this project and refactor the name to something else to avoid name shadowing.

Comment actions Permalink

Thank you Andrey Resler. I believe that this is, in fact, the problem.  I had not noticed the platform module.


Comment actions Permalink

I named a code file as signal.py. I received "AttributeError: module 'platform' has no attribute 'python_implementation'" error due to this name. I renamed it to something else to resolve the error. 

The error occurs only in debug mode. Run mode works fine.

Comment actions Permalink



please vote for the following feature request https://youtrack.jetbrains.com/issue/PY-23615 in order to increase its priority. Thank you! 


Please sign in to leave a comment.