pycharm打开python或者django的控制台报错



 /usr/bin/python2.7 -u /home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydevconsole.py 36487 47774
PyDev console: starting.import sys; print('Python %s on %s' % (sys.version, sys.platform))
Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
[GCC 4.8.2] on linux2
Traceback (most recent call last):
  File "/home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydev_console_utils.py", line 228, in addExec
    self.finishExec(more)
  File "/home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydev_console_utils.py", line 385, in finishExec
    return server.NotifyFinished(more)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused
sys.path.extend(['/home/zy/code/python/saeLab108/108lab/5', '/home/zy/software/code/pycharm-3.4.1/helpers/pycharm', '/home/zy/software/code/pycharm-3.4.1/helpers/pydev'])
Traceback (most recent call last):
  File "/home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydev_console_utils.py", line 228, in addExec
    self.finishExec(more)
  File "/home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydev_console_utils.py", line 385, in finishExec
    return server.NotifyFinished(more)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused
import django_manage_shell; django_manage_shell.run("/home/zy/code/python/saeLab108/108lab/5")
Traceback (most recent call last):
  File "/home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydev_console_utils.py", line 228, in addExec
    self.finishExec(more)
  File "/home/zy/software/code/pycharm-3.4.1/helpers/pydev/pydev_console_utils.py", line 385, in finishExec
    return server.NotifyFinished(more)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused

有人遇到么? 重启了电脑,新建了工程,都不行? 用命令行:python manage.py shell是可以的

python pycharm

佐仓教徒母球 10 years, 3 months ago

后来重新启动pycharm的控制台不知道怎么就好了
有可能是pycharm的bug

滴血的内脏 answered 10 years, 3 months ago

你是在 debug ?
如果不是的话 可以直接按快捷键运行当前文件,也可以在当前文件中右键 选择 Run "文件名"

兜兜里真有糖 answered 10 years, 3 months ago

Your Answer