# Obsolete Python docs, and mismatch between Python client and server running in Docker

**URL:** <https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549>\
**Category:** TypeDB Clients\
**Created:** [28 July 2024 02:53 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549 "2024-07-28T02:53:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Brown](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/jeff_brown/32/138_2.png) [@Jeff\_Brown](https://forum.typedb.com/u/Jeff_Brown)\
**Post date:** [28 July 2024 02:53 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/1 "2024-07-28T02:53:38Z")

</div>

Hello,

I’m making one thread out of these two issues because they seem very related.

Everything described below I discovered by running tweaks of the QuickStart script[1] in an iPython shell from within the TypeDB docker container (called “vaticle/typedb”, with image ID 0f332410e5cb, up to date according to DockerHub as of today).

# Some obsolete documentation

The first instruction at the Overview[1] of the Python driver is to run `pip install typedb-driver`. That package is no longer in PyPi, but `typedb-client` is, so I installed the latter.

The QuickStart goes on to suggest some code, starting with `from typedb.driver import TypeDB, SessionType, TransactionType`. That module does not exist, but `typedb.client` does, and those types are all available within it.

Once I replaced every instance of the string “driver” to “client” (the two important targets being the module `typedb.driver` and the object `TypeDB.core_driver`), I was able to execute the script – which uncovered the second issue.

# Version mismatch

Running that QuickStart code resulted in an error, the money quote from which appears to be the following:

```auto
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "[SRV26] Invalid Server Operation: A protocol version mismat
ch was detected. This server supports version '3' but the driver supports vers
ion '1'. Please use a compatible driver to connect.

```

[1] [https://typedb.com/docs/drivers/python/overview](https://typedb.com/docs/drivers/python/overview)

---

<div class="post-metadata">

**Author:** ![krishnan](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/krishnan/32/36_2.png) [@krishnan](https://forum.typedb.com/u/krishnan)\
**Post date:** [28 July 2024 08:34 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/2 "2024-07-28T08:34:06Z")

</div>

Hi Jeff,  
You’ll want to check the compatibility versions of the driver and server in the [compatibility table](https://typedb.com/docs/drivers/python/overview#_version_compatibility)

TypeDB Client was renamed to TypeDB driver from version 2.19 onwards. Here is `typedb-driver` on pypi: [typedb-driver · PyPI](https://pypi.org/project/typedb-driver/)  
As the error message suggests, the driver (typedb-client, likely 2.18.2 with protocol version 1) you’ve installed is indeed two protocol versions behind the current server ( 2.28.3 with protocol version 3).  
Could you try installing it again, and if it doesn’t work, let us know what version of python + platform you’re using?

---

<div class="post-metadata">

**Author:** ![Jeff\_Brown](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/jeff_brown/32/138_2.png) [@Jeff\_Brown](https://forum.typedb.com/u/Jeff_Brown)\
**Post date:** [28 July 2024 23:19 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/3 "2024-07-28T23:19:50Z")

</div>

Thanks a lot! With your help I got it working.

# Solution

I built a new Docker image. The Dockerfile and pip requirements file for it are here:

> **[hode6/docker at 3f581ecd4cdb30a13c99be2f7ccf8a443ca9cd5d ·...](https://github.com/JeffreyBenjaminBrown/hode6/tree/3f581ecd4cdb30a13c99be2f7ccf8a443ca9cd5d/docker)**
>
> A higher order data editor, take six-ish. Contribute to JeffreyBenjaminBrown/hode6 development by creating an account on GitHub.

That uses Ubuntu 23.11, which is the latest image for which the default version of Python is 3.11 (the most recent that the TypeDB driver is compatible with). That compatibility chart you linked to was critical – otherwise I would have been stumped, not realizing that Python 3.12 is too new.

# What the problem was … maybe

I had been TypeDB from the Docker image that you provide:

> **[Image Layer Details - vaticle/typedb:latest](https://hub.docker.com/layers/vaticle/typedb/latest/images/sha256-b62f455c89fb1a31ee7c1ec0af9f2b5ed452a6507b594f7447b5df9f2f92313f)**

From that image, when I run `pip install typedb-driver` I would get a `can't find it` error:

```auto
root@26f767b4e868:/opt/typedb-all-linux-x86_64# pip install typedb-driver
ERROR: Could not find a version that satisfies the requirement typedb-driver (from versions: none)
ERROR: No matching distribution found for typedb-driver
root@26f767b4e868:/opt/typedb-all-linux-x86_64#

```

It _might_ be because that Docker image uses a four-year-old version of Ubuntu:

```auto
root@26f767b4e868:/opt/typedb-all-linux-x86_64# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"

```

But maybe it was something else.

---

<div class="post-metadata">

**Author:** ![krishnan](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/krishnan/32/36_2.png) [@krishnan](https://forum.typedb.com/u/krishnan)\
**Post date:** [30 July 2024 16:28 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/4 "2024-07-30T16:28:36Z")

</div>

That’s a use case for our docker image we didn’t really expect.  
We expected it to be used to just run the TypeDB server, and the driver/clients would run on the user’s host machines.

---

<div class="post-metadata">

**Author:** ![joshua](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/joshua/32/28_2.png) [@joshua](https://forum.typedb.com/u/joshua)\
**Post date:** [30 July 2024 16:32 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/5 "2024-07-30T16:32:41Z")

</div>

Interesting - indeed this is not what we had envisioned. We’re planning on releasing a Python driver that works with 3.12 of Python soon-ish as well.

---

<div class="post-metadata">

**Author:** ![Jeff\_Brown](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/jeff_brown/32/138_2.png) [@Jeff\_Brown](https://forum.typedb.com/u/Jeff_Brown)\
**Post date:** [30 July 2024 16:56 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/6 "2024-07-30T16:56:42Z")

</div>

I see, that makes sense. The reason I’m doing it this way is I that use NixOS, and the TypeDB driver (at least the Python one) is not packaged for NixOS. (I once managed to package something for NixOS, but it was hard, and I don’t have the kind of free time I used to.)

---

<div class="post-metadata">

**Author:** ![D\_Krass](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@D\_Krass](https://forum.typedb.com/u/D_Krass)\
**Post date:** [8 September 2024 15:13 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/7 "2024-09-08T15:13:21Z")

</div>

I’m still facing the same error: “[SRV26] Invalid Server Operation: A protocol version mismatch was detected. This server supports version ‘3’ but the driver supports version ‘1’.”  
Python typedb client: typedb-client==2.18.2 running on local Python 3.11.9  
docker image: vaticle/typedb-latest (version: 2.28.3, pulled 8. Sep 2024)

---

<div class="post-metadata">

**Author:** ![Jeff\_Brown](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/jeff_brown/32/138_2.png) [@Jeff\_Brown](https://forum.typedb.com/u/Jeff_Brown)\
**Post date:** [8 September 2024 17:57 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/8 "2024-09-08T17:57:59Z")

</div>

The doctor container I built might solve that problem. It did for me, anyway. You can find the recipe here:

[https://github.com/JeffreyBenjaminBrown/hode6/tree/main/docker](https://github.com/JeffreyBenjaminBrown/hode6/tree/main/docker)

Or you can just download the image, already built:

[https://hub.docker.com/layers/jeffreybbrown/hode/latest/images/sha256-79bfcafbb27eb59c536c863e5904c6eff8616eb25f99a9f5cc4754f69690c162?context=explore](https://hub.docker.com/layers/jeffreybbrown/hode/latest/images/sha256-79bfcafbb27eb59c536c863e5904c6eff8616eb25f99a9f5cc4754f69690c162?context=explore)

---

<div class="post-metadata">

**Author:** ![krishnan](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/krishnan/32/36_2.png) [@krishnan](https://forum.typedb.com/u/krishnan)\
**Post date:** [9 September 2024 05:59 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/9 "2024-09-09T05:59:05Z")

</div>

You need to use a newer driver version. Note that the package has been renamed to `typedb-driver` starting version 2.19.  
So you’ll have to do: `pip install typedb-driver`

---

<div class="post-metadata">

**Author:** ![D\_Krass](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@D\_Krass](https://forum.typedb.com/u/D_Krass)\
**Post date:** [9 September 2024 11:30 UTC](https://forum.typedb.com/t/obsolete-python-docs-and-mismatch-between-python-client-and-server-running-in-docker/549/10 "2024-09-09T11:30:35Z")

</div>

ah, thank you very much!

Dieter
