下载Python库

一、控制台中下载

1.win+R->cmd->pip install 库名称->回车,等待下载完成即可

如果下载失败,使用以下方法:

2.网站上下载,然后安装

https://www.lfd.uci.edu/~gohlke/pythonlibs/

pip install 下载的whl文件路径(将文件拖到命令行快速输入)

3.国内镜像资源网站下载

pip --default-timeout=1000 install 库名称 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

pip国内的一些镜像

    阿里云 http://mirrors.aliyun.com/pypi/simple/ 
    中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 
    豆瓣(douban) http://pypi.douban.com/simple/ 
    清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 
    中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

临时使用时,可以在pip后添加 -i 参数,指定pip源:

# 比如安装pygame模块(任选其一)
pip install pygame -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pygame -i http://mirrors.aliyun.com/pypi/simple
pip install pygame -i http://pypi.douban.com/simple
pip install scrapy -i http://pypi.mirrors.ustc.edu.cn/simple

体验飞速模块安装:PIP更换国内安装源 – 老九维基

二、PyCharm中下载

File->Settings->

 左键双击

 添加网址

点击OK,等待下载 完成

资料:

Python常用库大全,看看有没有你需要的 - 爱漂泊人生 - 博客园

Could not find a version that satisfies the requirement (from versions: ) No matching distribution_GGF5.幻影的博客-CSDN博客

 

猜你喜欢

转载自blog.csdn.net/qq_55444696/article/details/125059046