【发布时间】:2014-05-18 12:13:24
【问题描述】:
我正在尝试在 Vagrant 中调试 Django 项目。
我确实搜索了答案并阅读了有关 Vagrant、使用 Pycharm 进行远程调试等的所有可用文档。
我现在所拥有的是完美运行的“运行”命令
ssh://vagrant@127.0.0.1:2222/home/vagrant/dev-projects/OP_3.0/bin/python2.7 -u
/home/vagrant/dev-projects/3.0/online_platform/manage.py runserver 8000
0 errors found
April 06, 2014 - 02:32:40
Django version 1.6.2, using settings 'local_settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
我可以从 HOST 访问它,一切正常。
但是当我尝试运行“调试”命令时,我有这个:
ssh://vagrant@127.0.0.1:2222/home/vagrant/dev-projects/OP_3.0/bin/python2.7 -u
/home/vagrant/pydev/pydevd.py --multiproc --client '0.0.0.0' --port 34117 --file /home/vagrant/dev-projects/3.0/online_platform/manage.py runserver 8000
Traceback (most recent call last):
File "/home/vagrant/pydev/pydevd_comm.py", line 310, in OnRun
self.handleExcept()
File "/home/vagrant/pydev/pydevd.py", line 1414, in handleExcept
ReaderThread.handleExcept(self)
File "/home/vagrant/pydev/pydevd_comm.py", line 329, in handleExcept
GlobalDebuggerHolder.globalDbg.FinishDebuggingSession()
AttributeError: 'NoneType' object has no attribute 'FinishDebuggingSession'
Traceback (most recent call last):
File "/home/vagrant/pydev/pydevd.py", line 1497, in <module>
dispatcher.connect(host, port)
File "/home/vagrant/pydev/pydevd.py", line 1400, in connect
self.reader.run()
File "/home/vagrant/pydev/pydevd_comm.py", line 252, in run
self.OnRun()
File "/home/vagrant/pydev/pydevd_comm.py", line 325, in OnRun
self.handleExcept()
File "/home/vagrant/pydev/pydevd.py", line 1414, in handleExcept
ReaderThread.handleExcept(self)
File "/home/vagrant/pydev/pydevd_comm.py", line 329, in handleExcept
GlobalDebuggerHolder.globalDbg.FinishDebuggingSession()
AttributeError: 'NoneType' object has no attribute 'FinishDebuggingSession'
Process finished with exit code 1`
任何真正的帮助,请...
【问题讨论】:
-
您的项目解释器设置为什么? jetbrains.com/pycharm/help/…
-
我们的开发环境有这个问题。
-
你不能使用 virtualenvs 吗?我知道很多时候他们不适合,但他们可以帮助解决这类问题
-
你解决了吗?如果是这样,请分享您的解决方案,我的脚本中有同样的问题,即使我没有使用 django 也没有 vagrant,只是 ssh 远程 python 解释器。
标签: python django debugging pycharm