qmasingarbe / pymiere

Python for Premiere pro
GNU General Public License v3.0
349 stars 46 forks source link

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=3000) #36

Open xxxss opened 2 years ago

xxxss commented 2 years ago

I have installed pymiere_link and I can see "Pymiere Link" in the extension of Window menu. But when I run "print(pymiere.objects.app.isDocumentOpen())" in python shell, it shows these error:

Traceback (most recent call last):
  File "D:\Python36\lib\site-packages\pymiere\core.py", line 39, in check_premiere_is_alive
    response = requests.get(PANEL_URL)
  File "D:\Python36\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "D:\Python36\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "D:\Python36\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "D:\Python36\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "D:\Python36\lib\site-packages\requests\adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=3000): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001B824B38828>: Failed to establish a new connection: [WinError 10061] ',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python36\lib\site-packages\pymiere\objects\start_vars.py", line 56, in app
    return Application(**_eval_script_returning_object('app', as_kwargs=True))
  File "D:\Python36\lib\site-packages\pymiere\core.py", line 469, in _eval_script_returning_object
    result = eval_script(script, decode_json=True)
  File "D:\Python36\lib\site-packages\pymiere\core.py", line 77, in eval_script
    check_premiere_is_alive(crash=True)
  File "D:\Python36\lib\site-packages\pymiere\core.py", line 43, in check_premiere_is_alive
    raise IOError(msg)
OSError: No connection could be established to Premiere Pro, check that the pymiere pannel is loaded

The version of Premiere Pro is 14.4.0 Os: Windows 10

qmasingarbe commented 2 years ago

Hi @xxxss , It seems the script cannot communicate with the panel in Premiere Pro. It may be because the port used by the pannel is already in use by another application (port 3000 on local url 127.0.0.1). Can you use the command netstat -ano | find "3000" and see if something appears?

qmasingarbe commented 2 years ago

Closed due to inactivity, let me know if you need to reopen it

yayayru commented 1 year ago

Hello, I have the problem too. netstat -ano | find "3000" command does not see the port, see:

(venv) D:\git\github_alien\pymiere>python demo.py
Traceback (most recent call last):
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connection.py", line 174, in _new_conn
    conn = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\util\connection.py", line 95, in create_connection
    raise err
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [WinError 10061] Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "C:\Users\Alexey\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\Alexey\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\Alexey\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\Alexey\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1037, in _send_output
    self.send(msg)
  File "C:\Users\Alexey\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 975, in send
    self.connect()
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connection.py", line 205, in connect
    conn = self._new_conn()
           ^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001EAF3C6F810>: Failed to establish a new connection: [WinError 10061] Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\requests\adapters.py", line 489, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\urllib3\util\retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=3000): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001EAF3C6F810>: Failed to establish a new connection: [WinError 10061] Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\git\github_alien\pymiere\pymiere\core.py", line 39, in check_premiere_is_alive
    response = requests.get(PANEL_URL)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\venv\Lib\site-packages\requests\adapters.py", line 565, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=3000): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001EAF3C6F810>: Failed to establish a new connection: [WinError 10061] Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\git\github_alien\pymiere\demo.py", line 11, in <module>
    project_opened, sequence_active = wrappers.check_active_sequence(crash=False)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\pymiere\wrappers.py", line 21, in check_active_sequence
    if not pymiere.objects.app.isDocumentOpen():
           ^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\pymiere\objects\start_vars.py", line 56, in app
    return Application(**_eval_script_returning_object('app', as_kwargs=True))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\pymiere\core.py", line 472, in _eval_script_returning_object
    result = eval_script(script, decode_json=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\git\github_alien\pymiere\pymiere\core.py", line 77, in eval_script
    check_premiere_is_alive(crash=True)
  File "D:\git\github_alien\pymiere\pymiere\core.py", line 43, in check_premiere_is_alive
    raise IOError(msg)
OSError: No connection could be established to Premiere Pro, check that the pymiere pannel is loaded

(venv) D:\git\github_alien\pymiere>netstat -ano | find "3000"

(venv) D:\git\github_alien\pymiere>
qmasingarbe commented 1 year ago

Hello @YAYAYru , Do you see PymiereLink in Premiere Pro's Window>Extension menu ?