win10系统,安装了pycharm community 2019.3版本,安装包文件有2种方法
方法1:
1、在pycharm中File---setting,出现如下界面
选择Project Interpreter,点击右方的“+”号,在列表中输入需要安装的库,然后点击左下方install。
使用这种方法有时候会遇到以下错误:
Microsoft Visual C++ 14.0 is required
主要参考以下博客:
https://blog.csdn.net/qq_38161040/article/details/87929616
可以通过以下3种方法解决:
①、安装vc++运行库集合
通过下面的链接下载C++运行库官方安装工具,然后直接安装即可。
链接:https://pan.baidu.com/s/1d-Ni5jn27qWENLJ74NrV-w
提取码:b11n
②、下载whl库到本地直接安装。
pipy官方下载:https://pypi.org/
lfd.uci.edu下载:https://www.lfd.uci.edu/~gohlke/pythonlibs/
注意,有时候安装一些库,可能第一个官方链接没有对应的版本,导致pycharm安装错误,比如安装PIL时,报以下错误:
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
所以,这种情况下可以尝试从第二个非官方链接下载对应的whl安装包,注意选择与自己python版本和主机操作系统相匹配的版本下载。这个对应第二种安装方式。
方法二:直接下载whl库进行安装
(1)通过官方或非官方下载包对应的whl文件到本地;
(2)通过cmd安装wheel,在cmd中输入pip install wheel,如下图所示:
(3)然后cd到whl的文件夹,在命令行中输入pip install xxx.whl