My desktop runs Bullseye, and I haven't had the opportunity to do a proper backup before updating to Bookworm. As a result, I regularly run into tools I want to run that want a more recent version of this or that. Open-Interpreter, a CLI tool for ChatGPT, is one such tool. You can install it with python's pip, but it wants Python 3.10 or newer and Bullseye runs 3.9.
So first you have to download, build, and install python-3.10 or newer:
wget https://www.python.org/ftp/python/3.11.6/Python-3.11.6.tgz
tar zxvf Python-3.11.6.tgz
cd Python-3.11.6/
make -j $(grep -c processor /proc/cpuinfo) //run one make process per CPU thread
sudo make altinstall
At the time of writing, aiohttp and tiktoken, modules used by open-interpreter, won't install under Python 3.12, so I'm installing the latest Python 3.11. make altinstall will install in /usr/local/bin, and won't replace the Debian installed Python.
Next you need to set up a venv and install open-interpreter in there:
cd
python3.11 -m venv open-interpreter
open-interpreter/bin/activate
pip install --upgrade pip
pip install open-interpreter
Ok, it's installed! One problem. It uses a library called Chroma, and Chroma is dependant on sqlite3, but it wants a version newer than 3.35.0, and Bullseye comes with 3.34. The workaround is to fix chroma to use pysqlite3
pip install pysqlite3-binary
echo <<EOF >foo.tmp
__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
EOF
cat lib/python3.11/site-packages/chromadb/__init__.py foo2.tmp
cat foo.tmp foo2.tmp >> lib/python3.11/site-packages/chromadb/__init__.py
Next, and we're almost done, you want to put your OPENAI API key into an environment variable.
echo OPENAI_API_KEY=YourKeyGoesHere >>~/.bashrc
. .bashrc
You should be good to go now.
interpreter