Files
weiyu/modules/python/readme.zh.md
2024-12-14 10:43:31 +08:00

1.8 KiB

微语ai

初始化步骤

# 设置国内镜像
# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# poetry source add --priority=default mirrors https://pypi.tuna.tsinghua.edu.cn/simple/
brew install libmagic
# 设置代理
export http_proxy=http://127.0.0.1:10818
export https_proxy=http://127.0.0.1:10818
# 清理缓存
pip cache purge
# 生成虚拟环境
python -m venv .venv
# 激活虚拟环境
source .venv/bin/activate
# 退出虚拟环境
# deactivate
# 查看python路径
which python
# 安装poetry
pip install poetry
poetry config virtualenvs.prefer-active-python true
# 查看python路径
poetry run which python
# 安装依赖某个依赖库
poetry add fastapi, uvicorn
# 安装所有依赖
poetry install --no-root
# 运行程序
python main.py
# nohup python main.py > output.log 2>&1 &
# 排除embeddings文件夹
sh cicd/scripts/release.sh
# 上传所有
sh cicd/scripts/release-all.sh

运行

# 激活虚拟环境
source .venv/bin/activate
# 运行程序
python main.py