网站地图 联系我们

学习python首选-实战python学习班,专注于python高级工程师培养,python课程:包括Python核心编程技术、全栈开发、网络爬虫、人工智能等。python全栈工程师+提高工作经验,获取免费试听课程!
当前位置: python培训 > python学习 > 常见问题 > 正文

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

来源:肚皮舞 浏览量: 发布日期:20-08-31 10:58:35 调整字体大小【 【所属栏目:常见问题】

  /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 "文件名"

标签:
肚皮舞新闻动态News Center

肚皮舞视频

肚皮舞培训课程

联系卡伊丝contact us
联系我们
python培训「零基础入门到精通」python人工智能编程培训班-0798wz.com

咨询热线:18301225663