Ubuntu18.04 python pip 安装模块方法

Anaconda版

anaconda安装
下载地址:https://www.anaconda.com/products/individual/
进入到下载目录执行安装

bash Anaconda3-5.3.1-Linux-x86_64.sh

pip安装模块

/home/anaconda3/bin/python3.7 -m pip install module_name

ps: 安装时指定python解释器,以免安装位置错误

普通版

pip安装模块

/usr/bin/python3 -m pip install module_name

ps:同样需指定python解释器

加速资源下载,国内镜像

国内镜像源收集
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/

使用方法

/usr/bin/python3 -m pip install module_name -i https://pypi.tuna.tsinghua.edu.cn/simple

猜你喜欢

转载自blog.csdn.net/qq_43314560/article/details/112555782