1、安裝openssl
wget https://www.openssl.org/source/openssl-1.1.1n.tar.gz --no-check-certificate
tar -xvf openssl-1.1.1n.tar.gz
cd openssl-1.1.1n
./config --prefix=/usr/local/openssl
make -j && make install
2、升級python3.10 (需要先安裝前面一步,調用openssl,否者會出錯)
wget https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tgz
tar -xvf Python-3.10.11.tgz
cd Python-3.10.11
./configure --prefix=/usr/local/python3 --with-openssl-rpath=auto
make -j && make install
echo export PATH=/usr/local/python3/bin:$PATH >> /etc/profile
echo export PATH=/usr/local/python3/bin:$PATH >> /root/.bashrc
source /etc/profile
3、升級pip3
pip3 install --upgrade pip
4、升級sqlite3
wget https://www.sqlite.org/2023/sqlite-autoconf-3440200.tar.gz
tar -xvf sqlite-autoconf-3440200.tar.gz
cd sqlite-autoconf-3440200
./configure
make -j && make install
vim /etc/ld.so.conf.d/sqlite.conf
# 內容如下
/usr/local/lib
5、安裝擴展
pip3 install mysql-connector-python
pip3 install -U sentence-transformers==2.2.2
pip3 install python-multipart
6、安裝chromadb
pip3 install chromadb
//服務端
/usr/local/python3/bin/chroma run --host 127.0.0.1 --port 8000 --path /www/wwwroot/chromadb
//客戶端
/usr/local/python3/bin/uvicorn chroma:app --reload --port 8002