python安装包依赖包pip3

 

官网包地址

https://pypi.org/

 

# 安装pip3 

yum install python3-pip

 

# 卸载

pip3 uninstall 包名

# 强制卸载

pip3 uninstall -y 包名

# 卸载指定版本的包

pip3 uninstall 包名==version

 

# 卸载安装包及依赖

pip3 install pip3-autoremove
pip3-autoremove 包名

 

## 清华源

```
-i https://pypi.tuna.tsinghua.edu.cn/simple

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

 

 

```
下载包及其依赖包
pip download allure-pytest -d path_to_folder

下载 allure-pytest 及依赖包到 path_to_folder 目录下
```

pip3 download paddleocr -d paddleocr/

或者 根据已有req下载

pip3 download -d paddleocr/ -r req.txt

 

### 安装包及其依赖包

```
pip install --no-index --find-links=path_to_folder allure-pytest

--no-index 告诉 pip 不要从 PyPI 下载包 而是从本地或其他指定的源进行安装。
--find-links 指定一个目录,pip 会在该目录中查找包文件并安装。

从 --find-links目录中安装 安装allure-pytest及其依赖包
```

# 文件安装 requirements

pip3 install [options] -r <requirements file>

pip3 install -r requirements.txt

 

pip3 install --no-index --find-links=paddleocr/ paddleocr

或者 根据已有req安装

pip3 install --no-index --find-links=paddleocr/ -r req.txt

 

#生成requirements,所有的python依赖包 ,环境中安装的所有 Python 包及其版本

pip3 freeze > requirements.txt

# 进入本项目目录,生成requirements,只包含本项目用到的库

pip3 install pipreqs

pipreqs ./ --encoding=utf8 --force

posted @ 2024-07-18 17:14  zmm521  阅读(105)  评论(0)    收藏  举报