以pygame模块举例
1,通过pycharm导入 (1)直接点击install package pygame就可以  出现以下情况则安装正确  如果出现错误可以试试把pip文件升级到最新 (2)通过python interpreter安装 步骤:File-Setting-python interprete  点击加号  搜索到pygame模块后点击install Package就可以 出现以下情况则安装正确  (3)卸载  同样在Python Interpreter中选择要删除模块点击减号就可以 出现这种情况则卸载完成  2,在终端通过pip安装 (1)安装 通过指令pip install pygame 安装模块,更多指令可以百度(指定路径、指定版本、指定下载源) 出现这样的情况则安装成功  重新进入pycharm则可以使用这个模块 (2)卸载 通过指令pip uninstall pygame 卸载模块 出现这样的情况则卸载成功  3,通过第三方python库安装 网站地址: https://www.lfd.uci.edu/~gohlke/pythonlibs/ 我电脑是64位并且用的是python3.7解释器(和cp37一致) 找到你想安装的文件下载(时间可能会有点长) 把这个文件放在python环境路径下  无法找到路径在设置中找到隐藏的项目  (1)先在电脑中安装wheel
pip install wheel
如果wheel文件安装不上,更新pip文件
python -m pip install --upgrade pip
(2)把whl文件粘贴到找到这个文件夹(这个文件夹是你自己的python环境变量路径)
C:\Users\16660\AppData\Local\Programs\Python\Python37\Lib\site-packages
(3)在终端使用一以下命令进入到此文件夹下
cd C:\Users\16660\AppData\Local\Programs\Python\Python37\Lib\site-packages
(4)然后安装此文件
pip install pygame-2.0.3-cp37-cp37m-win_amd64.whl
 再次进入pycharm你会发现pygame包可以用了 (5)卸载
pip uninstall pygame-2.0.3-cp37-cp37m-win_amd64.whl
如下显示则删除完成 
|