玩蛇网提供最新Python编程技术信息以及Python资源下载!
您现在的位置: 玩蛇网首页 > Python问题解答 > 正文内容

pycharm打开python与django控制台出现Connection refused错误

/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是可以的

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

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

玩蛇网文章,转载请注明出处和文章网址:http://www.iplaypy.com/wenda/wd19095.html

相关文章 Recommend

玩蛇网Python互助QQ群,欢迎加入-->: 106381465 玩蛇网Python新手群
修订日期:2017年05月22日 - 08时39分45秒 发布自玩蛇网

我要分享到:

必知PYTHON教程 Must Know PYTHON Tutorials

必知PYTHON模块 Must Know PYTHON Modules