PyCharm安装模块(两种方法,新手必看)
想在 PyCharm 中安装某个特定的模块,有两种方式,接下来给大家逐个进行讲解。
我这里是因为已经安装了,所以会出现这个。安装模块:
如果觉得安装太慢,可以用下面的方法:
同样也可以指定版本:
选择自己的项目名称,然后点击加号:
搜索要按照的库,然后还可以选择库的版本,最后点击安装即可:
PyCharm安装模块方法一

pip install 模块名
可以指定安装版本 如安装 requests 版本是 2.25.1:pip install requests == 2.25.1
如果觉得安装太慢,可以用下面的方法:
pip install -i 镜像源网址 模块名
这里大家可以使用下面三个常见的镜像源网址:- 阿里云镜像源:http://mirrors.aliyun.com/pypi/simple/
- 清华镜像源:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
- 豆瓣镜像源:https://pypi.doubanio.com/simple
同样也可以指定版本:
pip install -i https://mirrors.tuna.tsinghua.edu.cn/help/pypi/ requests == 2.25.1
查看可以升级的包:pip list --outdate
升级包:pip install --upgrade 包名
卸载模块:pip uninstall 模块名
我们也可以查看自己安装了多少模块:pip list
PyCharm安装模块方法二
在新版 pycharm 中,点击左上角的菜单,找到设置并点击:
选择自己的项目名称,然后点击加号:

搜索要按照的库,然后还可以选择库的版本,最后点击安装即可:
