# Python Docker SDK error: invalid proto, expected tcp

**URL:** <https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310>\
**Category:** General\
**Created:** [March 14, 2024, 2:11am UTC](https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310 "2024-03-14T02:11:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neuralmavendatamaestro](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@neuralmavendatamaestro](https://forums.docker.com/u/neuralmavendatamaestro)\
**Post date:** [March 14, 2024, 2:11am UTC](https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310/1 "2024-03-14T02:11:11Z")

</div>

I am facing this error whenever I try to use docker

`unable to resolve docker endpoint: Invalid proto, expected tcp: http://127.0.0.1:5000`

---

<div class="post-metadata">

**Author:** ![matthiasradde](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/matthiasradde/32/30830_2.png) [@matthiasradde](https://forums.docker.com/u/matthiasradde)\
**Post date:** [March 14, 2024, 5:16am UTC](https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310/2 "2024-03-14T05:16:23Z")

</div>

Good morning,  
what (which command) were you trying before this message appeared?

---

<div class="post-metadata">

**Author:** ![neuralmavendatamaestro](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@neuralmavendatamaestro](https://forums.docker.com/u/neuralmavendatamaestro)\
**Post date:** [March 14, 2024, 5:38am UTC](https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310/3 "2024-03-14T05:38:29Z")

</div>

This message appears for all commands even when I just simply type docker.

---

<div class="post-metadata">

**Author:** ![neuralmavendatamaestro](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@neuralmavendatamaestro](https://forums.docker.com/u/neuralmavendatamaestro)\
**Post date:** [March 14, 2024, 5:44am UTC](https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310/4 "2024-03-14T05:44:59Z")

</div>

Here is a error log while using Docker SDK for python

```auto
Traceback (most recent call last):
  File "C:\files\appData\Projects\PycharmProjects\AWSDispatch\AWSConfig\temp.py", line 3, in <module>
    client = docker.from_env()
  File "C:\files\appData\Projects\PycharmProjects\AWSDispatch\.venv\lib\site-packages\docker\client.py", line 94, in from_env
    return cls(
  File "C:\files\appData\Projects\PycharmProjects\AWSDispatch\.venv\lib\site-packages\docker\client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "C:\files\appData\Projects\PycharmProjects\AWSDispatch\.venv\lib\site-packages\docker\api\client.py", line 136, in __init__
    base_url = utils.parse_host(
  File "C:\files\appData\Projects\PycharmProjects\AWSDispatch\.venv\lib\site-packages\docker\utils\utils.py", line 287, in parse_host
    raise errors.DockerException(
docker.errors.DockerException: Invalid bind address format: port is required: tcp://http://127.0.0.1:5000

```

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [March 14, 2024, 9:54pm UTC](https://forums.docker.com/t/python-docker-sdk-error-invalid-proto-expected-tcp/140310/5 "2024-03-14T21:54:48Z")

</div>

* * *

I edited your messages. Please, format your post next time according to the following guide: [How to format your forum posts](https://forums.docker.com/t/how-to-format-your-forum-posts/127295)  
In short: please, use `</>` button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

````auto
```
echo "I am a code."
echo "An athletic one, and I wanna run."
```

````

* * *

I also changed the topic title. Please always chose a title that shortly describes the issue instead of only saying that it is an issue, which is obvios. Thank you.

Regarding the error message it seems pretty clear about that you used the http potocol when it would require tcp protocol. As you cans ee in the error message, tcp was added before the url, so you don’t even need to define the protocol. Just use the IP address and the port.
