2_PyCharm 2019导入python第三方库

1)  File→ Settings→ 找到Project Interpreter→ 点击“+”进入操作界面,如下图所示:

 

2)  在安装库之前,可选择性添加国内镜像源,点击Mange Repositories,如下所示:

 

3)  在Mange Repositories中,“+”添加、“-”删除,如下所示:

 

默认:https://pypi.python.org/simple/

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

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

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

中科大:https://pypi.mirrors.ustc.edu.cn/simple/ 

4)  在搜索框中输入库名,如numpy,选中需安装的库,然后点击Install Package,如下图所示:

 

5)  等待安装完成,第三方库将加入在Project Interpreter列表,如下所示:

 

原文地址:https://www.cnblogs.com/zhangshiwu/p/12253566.html