Python 的标准包管理器是 pip。允许安装和管理不属于 Python 标准库的包。
整套学习自学教程中应用的数据都是《三國志》、《真·三國無雙》系列游戏中的内容。
pip是一个安装和管理不作为标准库的一部分分发的库和依赖项的工具。
windows系统下。
C:\Users\Lenovo>where pip3
d:\MyTools\Anaconda3_5.2.0\Scripts\pip3.exe
Linux + maxOS系统下。
[root@VM_0_15_centos ~]# which pip3
/usr/bin/pip3
C:\> python -m venv venv
C:\> venv\Scripts\activate.bat
(venv) C:\> pip3 --version
pip 21.2.3 from ...\lib\site-packages\pip (python 3.10)
(venv) C:\> pip --version
pip 21.2.3 from ...\lib\site-packages\pip (python 3.10)
直接安装 python 的时候安装 Anaconda 版本全部自动化安装,这里都以 windows 环境举例。
pip install pandas
pip install pandas==xx.xx.xx
pip install --upgrade pandas
pip uninstall pandas
显示已经安装的三方包名称和版本。
python -m pip list
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣:http://pypi.douban.com/simple/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
永久更换镜像源。
新建pip目录 路径 C:\Users\xx\pip
新建文件pip.ini
[global]
timeout = 1000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple # 你要更换的
trusted-host = pypi.tuna.tsinghua.edu.cn
# 导出命令
pip freeze > requirements.txt
# 安装命令
pip install -r requirements.txt
| 留言与评论(共有 0 条评论) “” |