You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
620 B

3 months ago
## 一、项目相关
+ 创建或初始化项目
```shell
mkdir projectName
cd projectName && uv init --python 指定版本
```
目录结构如下
```text
.
├── .venv
│ ├── bin
│ ├── lib
│ └── pyvenv.cfg
├── .python-version
├── README.md
├── hello.py
├── pyproject.toml
└── uv.lock
```
+ 初始化虚拟环境,自动创建.venv文件夹
```shell
uv run main.py
```
+ 修改python包源编辑`pyproject.toml`文件,增加如下内容
```text
[[tool.uv.index]]
name = "private-pypi"
url = "https://mirrors.aliyun.com/pypi/simple/"
default = true
```