当前位置:首页 » 《随便一记》 » 正文

Python系列 - pip管理工具

13 人参与  2022年11月08日 09:37  分类 : 《随便一记》  评论

点击全文阅读


‍‍?博客主页:  Passerby_Wang的博客_CSDN博客-系统运维,云计算,Linux基础领域博主

?所属专栏:『Python系列』

?上期文章: 无

?如觉得博主文章写的不错或对你有所帮助的话,还望大家多多支持呀! 关注、点赞、收

藏、评论。

目录

一、介绍

二、配置镜像源

1、配置文件修改

1)Windows

2)Linux

2、临时指定镜像源下载

1)命令

2)实例

3、永久设置镜像源

1)命令

2)实例

三、推荐的镜像源

四、安装|卸载第三方库

1、安装第三方库

1)命令

2)实例

2、卸载第三方库

1)命令

2)实例

五、推荐第三方库


一、介绍

        pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装和卸载的功能,现在大家用到的所有包不是自带的就是通过pip安装的。Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具

二、配置镜像源

1、配置文件修改

1)Windows

1. Win键+ R键,打开运行对话框,输入%APPDATA%后,回车确认进入“C:\Users\用户名\AppData\Roaming”下,右键打开命令行;

2. 以配置阿里源为例,在当前路径下创建pip目录,在目录里新建pip.ini文件,输入以下内容。

[global]

index-url = https://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host = mirrors.aliyun.com

注:新建pip.ini文件前务必勾选“查看”-“显示”-“文件拓展名”

 

2)Linux

1. 命令

mkdir ~/.pip #创建文件夹vim ~.pip/pip.conf #编写配置文件,以配置阿里源为例[global]index-url = https://mirrors.aliyun.com/pypi/simple/[install]trusted-host = mirrors.aliyun.com

2. 实例

[root@wangwu ~]# mkdir ~/.pip[root@wangwu ~]# vim ~/.pip/pip.conf[global]index-url = https://mirrors.aliyun.com/pypi/simple/[install]trusted-host = mirrors.aliyun.com

2、临时指定镜像源下载

1)命令

pip install 模块名 -i http://mirrors.aliyun.com/pypi/simple/

2)实例

[root@wangwu ~]# pip install demjson -i https://mirrors.aliyun.com/pypi/simple/... ... ...Installing collected packages: demjsonSuccessfully installed demjson-2.2.4

3、永久设置镜像源

1)命令

pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/

2)实例

[root@wangwu ~]# pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/Writing to /root/.config/pip/pip.conf

三、推荐的镜像源

清华:https://pypi.tuna.tsinghua.edu.cn/simple/

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://mirrors.bfsu.edu.cn/pypi/web/simple/

豆瓣:http://pypi.douban.com/simple/

百度:https://mirror.baidu.com/pypi/simple/

四、安装|卸载第三方库

1、安装第三方库

1)命令

pip install 库名

2)实例

[root@wangwu ~]# pip install demjson... ... ...Installing collected packages: demjsonSuccessfully installed demjson-2.2.4

2、卸载第三方库

1)命令

pip uninstall 库名

2)实例

[root@wangwu ~]# pip uninstall demjson... ... ...Proceed (y/n)? y  Successfully uninstalled demjson-2.2.4

五、推荐第三方库

服务器后端:Django、request

程序打包:PyInstaller

程序消息提醒:win10toast   

爬虫:requests、selenium、scripy

数据可视化:matplotlib

机器学习:scripy、skipt-learn

Web开发:django、Pyramid

Json库:demjson     

图像处理:open-cv、pillow

视频:moviepy

音频:musicpy

游戏制作:pygame、easygui、tk

消息自动化:wxpy

表格自动化:openpyxl

自动化测试:selenium、unitTest


点击全文阅读


本文链接:http://zhangshiyu.com/post/47385.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1