简体   繁体   English

Pycharm调试是否适用于python3?

[英]Does Pycharm debug work with python3?

I'm on Mac OS X 10.8 and I've installed latest stable Python 3 (3.2.3) using Homebrew. 我使用的是Mac OS X 10.8,我使用Homebrew安装了最新的稳定的Python 3(3.2.3)。 Then I created a virtual environment using virtualenvwrapper - mkvirtualenv --no-site-packages --python=/usr/local/bin/python3 py3 I've configured Pycharm to use this virtualenv and I can run scripts, but I can't debug them, when I press debug Pycharm's debugger just quits: 然后我使用virtualenvwrapper创建了一个虚拟环境 - mkvirtualenv --no-site-packages --python=/usr/local/bin/python3 py3我已经配置Pycharm使用这个virtualenv我可以运行脚本,但我不能调试它们,当我按下调试Pycharm的调试器时退出:

/Users/qweqwe/.virtualenvs/py3/bin/python /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 61596 --file /Users/qweqwe/Dropbox/Works/test/python/asyncore_test.py
pydev debugger: process 84441 is connecting
Connected to pydev debugger (build 117.663)

Process finished with exit code 132

Am I missing something or Pycharm just can't debug python3? 我错过了什么或Pycharm只是无法调试python3?

Update: It doesn't work at all, no matter what the script is. 更新:无论脚本是什么,它都不起作用。 Even when debugging single line hello world debugger exits with error 即使在调试单行hello world调试器时也会出错

Yes. 是。 enter this in pycharm settings/Library/Frameworks/Python.framework/Versions/3.2/bin/python3(copied from Python3/MacOSX integration into pycharm ) 在pycharm设置/ Library / Frameworks / Python.framework / Versions / 3.2 / bin / python3中输入(从Python3 / MacOSX集成到pycharm中

I had the same problem yesterday,and you can try in this way: add 昨天我遇到了同样的问题,你可以这样试试:添加

if __name__ == '__main__': 

in your code , then set breakpoints and run Debugger. 在您的代码中,然后设置断点并运行调试器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM