VSCode 与 Python 常用设置、镜像与虚拟环境
VSCode
- 下载地址:点击下载
workbench:tree:indent设置为 8 的倍数- 图标主题:Material Icon Theme
- 主题:Catppuccin for VSCode
Python
- Python 3.10 下载:点击下载
国内镜像(pip)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple创建虚拟环境
# 安装 python3.11-venv 包
sudo apt install python3.11-venv
# 进入目标目录
cd /opt/1panel/apps/openresty/openresty/www/sites/wi6.cn/index/tv
# 创建虚拟环境
python3.11 -m venv .venv
# 激活虚拟环境
source .venv/bin/activate
# 安装依赖包示例
pip install requests
pip install -r requirements.txt
# 退出虚拟环境
deactivate虚拟环境设置变量
Linux 路径:
bin/activateexport TOKEN_360=your_token_hereWindows 路径:
Scripts/activate.batset TOKEN_360=your_token_here