Debugger problem Pycharm on windows

Answered

Hi,

I have a x64 Windows machine and I have installed Pycharm community edition 2018.3. I have configured the interpreter using the Anaconda distribution with Python 3.6.6.

Now, I am trying to run a very simple python script, reported in the following. The program runs just fine in normal mode. However, as soon as I insert a breakpoint, e.g., at the third line, the following message appears: "Connection to Python debugger failed: socket closed".

import pandas as pd

db1 = pd.DataFrame({'a': [1, 2, 3], 'b':[4, 5, 6]})

db1.head()

 

Any clue what this could be?

21 comments

My issue was fixed by following the advice in a comment on ticket [PY-33197](https://youtrack.jetbrains.com/issue/PY-33197):

Disable "PyQt compatible" checkbox in the Settings under Build, Execution, Deployment --> Python Debugger

2

Could you please once again add PYCHARM_DEBUG=True environment variable, debug and provide the whole console output?

Please also make sure that it is not blocked by a firewall/antivirus.

1

Hi,

Please add PYCHARM_DEBUG=True environment variable to your Run/Debug Configuration, reproduce the problem, then upload your renamed logs folder zipped (Help | Compress Logs and Show in...) to https://uploads.services.jetbrains.com/ and let me know the name of that zip file.

0

Hi,

 

Done. 

 

The name is: logs-LF-debugger_windows.zip

0

Thanks!

Could you please try 2018.3 version to see if problem remains?

0

Actually, I had 2018.3 and decided to downgrade it to 2018.2 to see if that solved the problem.

 

 

0

Having the exact same problem, running ubuntu 18.04, PyCharm 2018.03, using anaconda 4.5.11. 

0

Could you please add PYCHARM_DEBUG=True environment variable to Run/Debug Configuration, debug and provide the whole console output?

Please also make sure that it is not blocked by a firewall/antivirus.

0

Hi Sergey, I don't think it is being blocked by the firewall, I can debug just fine using Visual Studio Code, I would prefer to use PyCharm though.

here is the console output:

/home/username/anaconda3/envs/plotting/bin/python /snap/pycharm-community/99/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 42611 --file /home/username/PycharmProjects/plotting/Assignment3.py
Executing file /home/username/PycharmProjects/plotting/Assignment3.py
arguments: ['/home/username/PycharmProjects/plotting/Assignment3.py']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '42611')
('Connected.',)
debugger: received >>99 -1 46871
<<
Received command: ??? 99 -1 46871

Received port 46871

pydev debugger: process 19441 is connecting


Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

0

Please try setting PYDEVD_USE_CYTHON=NO and PYDEVD_USE_FRAME_EVAL=NO environment variables in your Run/Debug Configuration. Has is helped?

0

Hi Sergey,

Added those environment variables, and still the same problem, here is my console output:

/home/username/anaconda3/envs/plotting/bin/python /snap/pycharm-community/99/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 36641 --file /home/username/PycharmProjects/plotting/Assignment3.py
Executing file /home/username/PycharmProjects/plotting/Assignment3.py
arguments: ['/home/username/PycharmProjects/plotting/Assignment3.py']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '36641')
('Connected.',)
debugger: received >>99 -1 45883
<<
Received command: ??? 99 -1 45883

Received port 45883

pydev debugger: process 18687 is connecting


Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

0

Could you please submit it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY, attach idea.log and a sample code for reproducing?

0

What solved it for me is to make sure the file\folder being run isn't named "code".

 

How I found it:

Using PYCHARM_DEBUG=True as suggested by Sergey, I got this:

ModuleNotFoundError: No module named '_pydevd_bundle_ext'

Googling it I found this comment to an issue, where this solution was suggested.

 

Thank you all.

0

Hi,

I am getting the same problem. My code is running but my debugger is not working.

I don't have any module named code. I have set PYCHARM_DEBUG=True.

This is the error I am getting.

C:\Users\I504142\AppData\Local\Continuum\anaconda3\envs\support_using_ml\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 49706 --file C:/Users/I504142/Desktop/automated_bug_assessment-master/main.py -l 150 --use-lsa --logging -p
Using Cython speedups
Executing file C:/Users/I504142/Desktop/automated_bug_assessment-master/main.py
arguments: ['C:/Users/I504142/Desktop/automated_bug_assessment-master/main.py', '-l', '150', '--use-lsa', '--logging', '-p']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '49706')
('Connected.',)
debugger: received >>99 -1 49707
<<
Received command: ??? 99 -1 49707

Received port 49707

pydev debugger: process 18816 is connecting


Process finished with exit code -1073741819 (0xC0000005)

What to do ?

 

0

Hi Harchand,

Your problem is different.

What is your PyCharm version?

 

0

Hi Sergey, 

can you help me, 

I installed PyCharm 2018.3.3 by win 7. When I try "DEBUG 'my_some_file'", it show me some troubles: "Connection to Python debugger failed: socket closed".

C:\python_work\new_location\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.3\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 6600 --file C:/python_work/python_project.py
1
8
27
64
125
216
343
512
729
1000
[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.3\helpers\pydev\pydevd.py", line 15, in <module>
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PY34_OR_GREATER, IS_PY36_OR_GREATER, IS_PYCHARM, get_thread_id, \
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.3\helpers\pydev\_pydevd_bundle\pydevd_constants.py", line 168, in <module>
from _pydev_imps._pydev_saved_modules import thread
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.3\helpers\pydev\_pydev_imps\_pydev_saved_modules.py", line 21, in <module>
import xmlrpc.client as xmlrpclib
File "C:\Users\Артур\AppData\Local\Programs\Python\Python37-32\lib\xmlrpc\client.py", line 135, in <module>
from decimal import Decimal
File "C:\Users\Артур\AppData\Local\Programs\Python\Python37-32\lib\decimal.py", line 3, in <module>
from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'

 

And I can't use DEBUG. What it does mean? 

0

I renamed some files in current directory, like name.py , tupl.py, duplicated.py, and then DEBUG began to function. Only one bag - 

C:\Users\Артур\AppData\Local\Programs\Python\Python37-32\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.3\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 7476 --file C:/python_work/python_project.py
pydev debugger: process 7136 is connecting

0

@Atiacht

If renaming files changed the behavior, then you probably had one of the files named after some python module, which is known to cause issues sometime.

Is your issue now in that debugger is stuck at "pydev debugger: process 7136 is connecting" message? If so, please upload the logs which can be located according to https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files

You can upload the logs to our secure FTP: https://uploads.services.jetbrains.com/

Then let us know the file name please.

0

@Andrey Resler

It was stucked, but now number of error other. 

My logs logs-20190129-113117.zip

0

I can see several errors in the logs which may or may not be related. What error do you see in the application?

Here's one of the errors from the log:

com.intellij.execution.ExecutionException: Cannot start process, the working directory 'C:\python_work\python_project.py' is not a directory

Which may indicate you have incorrect configuration. Can you provide screenshots of your interpreter settings and your run/debug configuration?

0

When I attempt to debug a program I get the following error:

Connection to Python debugger failed

Socket operation on nonsocket: configureBlocking

 

This started happening to me today with no changes to my environment, everything worked well until this morning.

 

My version/environment info: 

PyCharm 2019.1 EAP (Community Edition)
Build #PC-191.5701.26, built on February 20, 2019
JRE: 11.0.2+154 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

 

I am having a similar result as @Harchand above:

C:\home\miniconda\envs\scw\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 191.5701.26\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 54561 --file C:/home/git/device_events/device_events/notifications.py --config_device C:/home/data/pullpoint/device.ini --config_nosql C:/home/data/pullpoint/dynamodb.ini
Using Cython speedups
Unable to load jupyter_debug plugin
Executing file C:/home/git/device_events/device_events/notifications.py
arguments: ['C:/home/git/device_events/device_events/notifications.py', '--config_device', 'C:/home/data/pullpoint/device.ini', '--config_nosql', 'C:/home/data/pullpoint/dynamodb.ini']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '54561')
('Connected.',)
debugger: received >>99 -1 54562
<<
Received command: ??? 99 -1 54562

Received port 54562

pydev debugger: process 7264 is connecting

Process finished with exit code -1073741819 (0xC0000005)

0

Please sign in to leave a comment.