23 lines
382 B
Markdown
23 lines
382 B
Markdown
---
|
|
title: python依赖固化
|
|
createTime: 2022/04/17
|
|
tags:
|
|
- Python
|
|
categories:
|
|
- 随记
|
|
---
|
|
|
|
## 生成 requirements.txt
|
|
|
|
```bash
|
|
pipreqs . --encoding=utf8 --force
|
|
```
|
|
|
|
如果使用`pip freeze > requirements.txt`会把当前环境中所有包全列入其中,如果项目运行在单个虚拟环境中时可以使用
|
|
|
|
## 安装
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|