From 84be5dea521e876a0436c99a2f4056372e72a00b Mon Sep 17 00:00:00 2001 From: Yuji Yokoo Date: Thu, 28 Nov 2024 15:54:45 +0900 Subject: [PATCH] Require psycopg 3 uninstalled in Jupyter notebook --- .../CipherStash-Getting-Started.ipynb | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/python/jupyter_notebook/CipherStash-Getting-Started.ipynb b/examples/python/jupyter_notebook/CipherStash-Getting-Started.ipynb index c57edb5..090f4d9 100644 --- a/examples/python/jupyter_notebook/CipherStash-Getting-Started.ipynb +++ b/examples/python/jupyter_notebook/CipherStash-Getting-Started.ipynb @@ -54,7 +54,18 @@ "metadata": {}, "source": [ "### Install dependency packages\n", - "As we will need to restart the Jupyter notebook kernel after installation, install `psycopg2`, `django` and `eqlpy` (from a specific branch):" + "As we will need to restart the Jupyter notebook kernel after installation, install `psycopg2`, `django` and `eqlpy` (from a specific branch).\n", + "Also, currently we only support psycopg2, not psycopg 3. Uninstall it if you have it:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1afdc85e-20ec-442a-a1d0-5a00ca0d0cba", + "metadata": {}, + "outputs": [], + "source": [ + "%pip uninstall --yes psycopg eqlpy" ] }, { @@ -235,7 +246,7 @@ "metadata": {}, "outputs": [], "source": [ - "%env CS_CLIENT_ACCESS_KEY=" + "%env CS_CLIENT_ACCESS_KEY=" ] }, { @@ -1085,7 +1096,7 @@ " ],\n", " DATABASES={\n", " \"default\": {\n", - " \"ENGINE\": \"django.db.backends.postgresql_psycopg2\",\n", + " \"ENGINE\": \"django.db.backends.postgresql\",\n", " \"NAME\": \"cipherstash_getting_started\",\n", " \"USER\": \"postgres\",\n", " \"PASSWORD\": \"postgres\",\n", @@ -1115,10 +1126,6 @@ "\n", "import os\n", "os.environ[\"DJANGO_ALLOW_ASYNC_UNSAFE\"] = \"false\"\n", - "# import asyncio\n", - "# from asgiref.sync import sync_to_async\n", - "#foo = await sync_to_async(Example.objects.all().delete)()\n", - "#print(foo)\n", "\n", "Example.objects.all().delete()\n", "\n",