Break points not working

Hi all,

     I'm having a problem with the PyCharm debugger - break points have stopped working.  Specifically - execution no longer stops at any break point in a django project.  I created a simple non-django project and was able to use break points just fine, however in my old and any new django projects break points simply do not work.  I think this problem started when I created a new virtualenv and added that new virtualenv as a new Python Interpreter in the PyCharm settings.  Not 100% sure, but it seems that after that my break points stopped working.  I have removed that virtualenv/Python Interpreter and things still don't work.

     Has anyone else run into a problem like this and solved it?  Any help would be greatly appreciated.

     I'm running PyCharm 1.2.1 (although the problem started in 1.2) on the latest Mac OS X with python 2.6.1.

     Thanks,

          Russ

12 comments

Hello Russell,

Could you please show the command line generated by PyCharm when you run

your Django application under a debugger?

I'm having a problem with the PyCharm debugger - break points

have stopped working.  Specifically - execution no longer stops at any

break point in a django project.  I created a simple non-django

project and was able to use break points just fine, however in my old

and any new django projects break points simply do not work.  I think

this problem started when I created a new virtualenv and added that

new virtualenv as a new Python Interpreter in the PyCharm settings.

Not 100% sure, but it seems that after that my break points stopped

working.  I have removed that virtualenv/Python Interpreter and things

still don't work.

Has anyone else run into a problem like this and solved it?  Any

help would be greatly appreciated.

I'm running PyCharm 1.2.1 (although the problem started in 1.2)

on the latest Mac OS X with python 2.6.1.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

/Users/russn/.virtualenvs/lincolnloop/bin/python /Applications/PyCharm 1.2.1.app/helpers/pydev/pydevd.py --client 127.0.0.1 --port 59763 --file manage.py runconcurrentserver localhost:8000

0

Hello Russell,

This is a known issue: http://youtrack.jetbrains.net/issue/PY-3378

The debugging will work if you don't use the 'runconcurrentserver' command.

/Users/russn/.virtualenvs/lincolnloop/bin/python /Applications/PyCharm

1.2.1.app/helpers/pydev/pydevd.py --client 127.0.0.1 --port 59763

--file manage.py runconcurrentserver localhost:8000

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

THANK YOU SO MUCH!!!  I've been suffering without the debugger for weeks now.  I'm so happy to have it back!

0

Hi,

I have the exact same problem, but I'm not running with any custom commands. This is what the console shows:

Connected to pydev debugger (build 107.576)
/Library/Frameworks/Python.framework/Versions/2.6/bin/python /Applications/PyCharm 1.5.4.app/helpers/pydev/pydevd.py --client 127.0.0.1 --port 58219 --file manage.py runserver --noreload 8000
pydev debugger: starting
Validating models...

0 errors found
Django version 1.3, using settings 'foxido.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

I have created a new fresh django project and the debugger stop on view's breakpoint so I think I have misconfigured something but I don't have any clue to where or what look for

Please any help will be appreciated

0

Hi Hugo,

so debugger DO stop on view's breakpoint or NOT?

And if it not, tell me, please, what is view file path and are there symliks in the project?

0

Hi Dmitry,

In any new project the debugger stops on breakpoints, but only on my current project don't, so I don't know what (setting/application/middleware??) is disabling the breakpoint.

Here is my config window:

foxido_conf.jpg

And here some relevant settings:

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'core.custom_context.root_path',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    #'django.contrib.admindocs',

    'jquery_validation',
    'tinymce',
    'pruebas_hugo',
    'sorl.thumbnail',
    'label_values',
    'core',
    'services',
    'request_service',
    'list_service',
    'accounts',
    'captcha',
    'bitly',
)

One last thing: Im sending emails from a different thread using this snippet:

t = threading.Thread(target=_send_email,
         args=['Subject', 'Body', settings.DEFAULT_FROM_EMAIL, [settings.DEFAULT_BCC_EMAIL, ]])
    t.setDaemon(True)
    t.start()



Attachment(s):
foxido_conf.jpg
0

The same problem here. Running PyCharm 2.5 with a google appengine project + Python 2.7. Threadsafe is set to yes in my app.yaml file.

No breakpoint stops the running code.

I've created the project on top of existing codebase, and tried to set up everything under the projects' settings, but probably miss something.

I run django using

.../.virtualenvs/gae/bin/python manage.py testserver --addrport 8000

or

.../.virtualenvs/gae/bin/python manage.py runserver 8000

Neither of them stopped for breakpoints.

1

This is my program code I am running it in PyCharm community edition

import Addingss
def calling():
m = Addingss.Mathematics()
x=m.add(10,20)
print("Addition" + str(x))
y=m.sub(40,30)
print("Subtraction" + str(y))
z=m.product(10,20)
print("Product" + str(z))
d=m.division(20,10)
print("Division" + str(d))
calling()

class Mathematics:
@classmethod
def add(cls,x,y):
return x+y

@classmethod
def sub(cls,x,y)->int:
return x-y

@classmethod
def product(cls,x,y)->int:
return x*y

@classmethod
def division(cls,x,y)->int:
return x/y

@classmethod
def exp(cls,x,y)->int:
return x**y

I don't know what wrong I am doing
C:\Python31\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 57373 --file C:/Users/xx41569/PycharmProjects/MyFirst/ss.py
PYDEVD_FILTER_LIBRARIES False
Started in multiproc mode
('Connecting to ', '127.0.0.1', ':', '57373')
('Connected.',)
debugger: received >>99 -1 57374
<<
Received command: ??? 99 -1 57374
Received port 57374
pydev debugger: process 8748 is connecting
('Connecting to ', '127.0.0.1', ':', '57374')
('Connected.',)
debugger: received >>501 1 0.1 WIN
<<
Received command: CMD_VERSION 501 1 0.1 WIN
Connected to pydev debugger (build 162.1967.10)
sending cmd -->          CMD_VERSION 501 1 @@BUILD_NUMBER@@
debugger: received >>111 3 python-line c:/users/xx41569/pycharmprojects/myfirst/ss.py 4 calling THREAD None None
<<
Received command: CMD_SET_BREAK 111 3 python-line c:/users/xx41569/pycharmprojects/myfirst/ss.py 4 calling THREAD None None
Added breakpoint:c:\users\xx41569\pycharmprojects\myfirst\ss.py - line:4 - func_name:b'calling'
debugger: received >>146 5 SHOW_RETURN_VALUES 1
101 7 
<<
Received command: CMD_SHOW_RETURN_VALUES 146 5 SHOW_RETURN_VALUES 1
Show return values: True
Received command: CMD_RUN 101 7 
IDE_PROJECT_ROOTS ['C:/Users/xx41569/PycharmProjects/MyFirst']
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\pydevd.py", line 1580, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\pydevd.py", line 964, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
    stream = tokenize.open(file)  # @UndefinedVariable
AttributeError: 'module' object has no attribute 'open'
Process finished with exit code 1



 

 

 

0

Had the same problem with standard server run parameters. Did File -> Invalidate caches and restart and the problem seems to be gone.

1

Hi, 

I have the same problem since I installed version 2016 on my Mac El Capitan. I tried all of the above including a clean install but it didn't help.

My config is: 

/Users/nicolas/odoo-env/bin/python "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 59616 --file /Users/nicolas/Sites/odoo10/odoo/odoo-bin -c ../gp.conf -d v10lgi2 -u gp_property -u gp_tenancy
pydev debugger: process 76610 is connecting

Connected to pydev debugger (build 163.10154.50)
2017-01-21 08:41:24,428 76610 INFO ? odoo: Odoo version 10.0
2017-01-21 08:41:24,428 76610 INFO ? odoo: Using configuration file at /Users/nicolas/Sites/odoo10/gp.conf
2017-01-21 08:41:24,429 76610 INFO ? odoo: addons paths: ['/Users/nicolas/Library/Application Support/Odoo/addons/10.0', u'/Users/nicolas/sites/odoo10/odoo/addons', u'/Users/nicolas/sites/odoo10/local_addons/gp', u'/Users/nicolas/sites/odoo10/community_addons', u'/Users/nicolas/sites/odoo10/community_addons/odoo-account', u'/Users/nicolas/sites/odoo10/community_addons/partner-contact', '/Users/nicolas/Sites/odoo10/odoo/odoo/addons']
2017-01-21 08:41:24,429 76610 INFO ? odoo: database: odooe9@default:default
2017-01-21 08:41:24,458 76610 INFO ? odoo.service.server: HTTP service (werkzeug) running on 0.0.0.0:8070

Can you help? Thanks.

0

Problem below is solved.  Fundamental ignorance about debugging functions.

Rule for newbies: You can't put a function in a py file and just plain old debug it.  After the function, you have to call it.

Instead of having just the function below, I should have added this line after the function:

test()

Then a right mouse and "Debug..." would have stopped at my break point.

 

Kind of same problem, but simpler.

I'm a Spyder refugee, just installed PyCharm CE this morning to use in a class.  Mainly I just want to run debug and step through code.  So I make a new "project".  Then create a new py file:


def test():
print("abc")
for i in range(10):
print(str(i + 5))
print("Done with for loop.")

I put a break point at the line with "for I in ..."

Right mouse, select the "Debug <file_name>..." and get this in the console window:

"C:\Program Files (x86)\Anaconda3\python.exe" "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.2\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 56231 --file C:/BigData/Python/W6_PyCharmProject/scratchpad4PyCharmW6.py
pydev debugger: process 3720 is connecting

Connected to pydev debugger (build 163.10154.50)

Process finished with exit code 0

None of the debug icon light up.

I tried this earlier, and it stopped at the break point.  Since I'm floundering around watching the intro video and trying things out, I have no idea what i might have changed.  Surely another newbie has encountered the same thing.

How do I get debug back?

0

Please sign in to leave a comment.