一、傻瓜式
在cmd命令行中,使用pip install 模块名,模块名可通过搜索获得,选择带有pypi的标识网址
实例1:
pip install redis #安装redis模块
返回结果:
Requirement already satisfied: redis in c:users13457appdatalocalprogramspythonpython38libsite-packages (3.5.0) #表明模块已安装好
二、官网上下载安装包
1、首先打开Pypi网址,搜索需要安装的模块,比如redis,点击download files
2、下载whl格式的安装包
使用pip install 文件所在的路径
例如:
pip install /Users/nhy/Downloads/PyMySQL-0.9.3-py2.py3-none-any.whl
3、下载tar.gz格式的安装包
1、先将tar解压
2、进入解压目录,找到setup.py文件
3、cmd 命令行执行命令 : python setup.py install
注意:建议使用pip 安装和whl安装,tar容易在解压时出错