博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python的第三方库安装教程详解
阅读量:2045 次
发布时间:2019-04-28

本文共 1203 字,大约阅读时间需要 4 分钟。

什么是第三方库

别人写好的一些功能代码,我们可以拿过来直接用

第三方库安装方法

1、pip在线安装(100%推荐)

默认源:pip install 包名

国内源:pip install 包名 -i http://mirrors.aliyun.com/pypi/simple/

注意:报黄色警告不要管

备注:常用的国内源地址

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

(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/
注意:pip源提示“not a trusted or secure host” 解决

问题:

The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host mirrors.aliyun.com’. Could not find a version that satisfies the requirement proxy (from versions: ) No matching distribution found for proxy
答案:
http://mirrors.aliyun.com/pypi/simple/
改成
https://mirrors.aliyun.com/pypi/simple/
注意:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='f 的解决办法

pip --default-timeout=1000 install -U 模块名

2、pycharm中安装

在这里插入图片描述在这里插入图片描述

3、离线安装(了解即可)

1)下载地址:(百度pypi就有)

2)下载XX.tar.gz 压缩包

在这里插入图片描述

3)对下载的安装包解压

4)把解压后的文件copy到python的安装路径中

5)cmd进入到下载的文件夹中,会看到setup.py文件

6)执行命令:python setup.py install

转载地址:http://xnaof.baihongyu.com/

你可能感兴趣的文章
leetcode 热题 Hot 100-2. 有效的括号
查看>>
leetcode 热题 Hot 100-3. 合并两个有序链表
查看>>
leetcode 热题 Hot 100-4. 对称二叉树
查看>>
Leetcode C++《热题 Hot 100-12》226.翻转二叉树
查看>>
Leetcode C++《热题 Hot 100-13》234.回文链表
查看>>
Leetcode C++《热题 Hot 100-14》283.移动零
查看>>
Leetcode C++《热题 Hot 100-15》437.路径总和III
查看>>
Leetcode C++《热题 Hot 100-16》448.找到所有数组中消失的数字
查看>>
Leetcode C++《热题 Hot 100-17》461.汉明距离
查看>>
Leetcode C++《热题 Hot 100-18》538.把二叉搜索树转换为累加树
查看>>
Leetcode C++《热题 Hot 100-19》543.二叉树的直径
查看>>
Leetcode C++《热题 Hot 100-20》617.合并二叉树
查看>>
Leetcode C++《热题 Hot 100-21》581.最短无序连续子数组
查看>>
Leetcode C++《热题 Hot 100-22》2.两数相加
查看>>
Leetcode C++《热题 Hot 100-23》3.无重复字符的最长子串
查看>>
Leetcode C++《热题 Hot 100-24》5.最长回文子串
查看>>
Leetcode C++《热题 Hot 100-25》11.盛最多水的容器
查看>>
Leetcode C++《热题 Hot 100-26》15.三数之和
查看>>
Leetcode C++《热题 Hot 100-27》17.电话号码的字母组合
查看>>
Leetcode C++《热题 Hot 100-28》19.删除链表的倒数第N个节点
查看>>