Как использовать консоль Python в Pycharm с помощью Docker для Mac - PullRequest
0 голосов
/ 21 мая 2018

Когда я запускаю приложение docker-compose в pycharm с docker compose, я не могу подключиться к консоли python.Все конфиги вроде бы хорошие.Pycharm сканирует переводчика со всеми требованиями.Но когда я открываю python console, я получаю сообщение об ошибке:

    018, 21:07:40) 
  [GCC 6.3.0 20170516] on linux
  Traceback (most recent call last):
  File "/opt/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 303, in run
    self._on_run()
  File "/opt/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 1521, in _on_run
    self.send_result(xml)
  File "/opt/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 1543, in send_result
    self.frame_accessor.ReturnFullValue(self.seq, xml.getvalue())
  File "/opt/python3.6/lib/python3.6/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/opt/python3.6/lib/python3.6/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/opt/python3.6/lib/python3.6/xmlrpc/client.py", line 1154, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/opt/python3.6/lib/python3.6/xmlrpc/client.py", line 1166, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
  File "/opt/python3.6/lib/python3.6/xmlrpc/client.py", line 1279, in send_request
    self.send_content(connection, request_body)
  File "/opt/python3.6/lib/python3.6/xmlrpc/client.py", line 1309, in send_content
    connection.endheaders(request_body)
  File "/opt/python3.6/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/python3.6/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/opt/python3.6/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/opt/python3.6/lib/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/opt/python3.6/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/opt/python3.6/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  socket.gaierror: [Errno -2] Name or service not known      

Я уже пробовал много разных решений, но никто не помогает мне

1 Ответ

0 голосов
/ 18 апреля 2019

Эта проблема была исправлена.Pycharm может подключиться к интерпретатору docker-compose через консоль python

...