# python_chromadb_write_data **Repository Path**: enzoism/python_chromadb_write_data ## Basic Information - **Project Name**: python_chromadb_write_data - **Description**: Python测试ChromaDB向量数据库 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-23 - **Last Updated**: 2026-10-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ChromaDB数据写入 ## 1-安装chromadb数据库 > 参考 [docker](docker) 文件夹中的执行脚本 --- ## 2-安装chromadb依赖 ```shell uv add chromadb ``` ---- ## 3-验证chromadb连接 ```python import chromadb # NOAUTH-连接远程服务 client = chromadb.HttpClient(host="localhost", port=8000) # AUTH-连接远程服务 # 注意:不同于Mysql或者其他数据库,chromaDB配置的是Authorization # client = chromadb.HttpClient( # host="localhost", port=8000, # headers={"Authorization": "Bearer my-strong-secret-token-123"} # ) # 检查心跳 print(client.heartbeat()) # 返回纳秒时间戳表示连接正常 print("chromaDB检查心跳-成功") ``` ----