安装python库问题记录

关于我在Terminal中安装xlwt包的过程中遇到的三次报错QAQ


第一次识失败

输入:pip install xlwt

输出:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: xlwt in d:\anaconda\lib\site-packages (1.3.0)

解决办法:

下载Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions (slproweb.com)里面的,安装路径不确定应该放在哪里,反正我安装在了File-Settings-Projest Structure里面所显示的路径

 

第二次失败

输入:pip install xlwt

输出:Requirement already satisfied: xlwt in d:\anaconda\lib\site-packages (1.3.0)

解决办法:加上--target=,具体格式参考第三次的输入

第三次失败

输入:pip install --target=d:\anaconda\lib\site-packages xlwt

输出:Collecting xlwt
  Using cached xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
Installing collected packages: xlwt
Successfully installed xlwt-1.3.0
WARNING: Target directory d:\anaconda\lib\site-packages\xlwt already exists. Specify --upgrade to force replacement.
WARNING: Target directory d:\anaconda\lib\site-packages\xlwt-1.3.0.dist-info already exists. Specify --upgrade to force replacement.

解决办法:在原本代码的末端加上“ --upgrade”,注意有个空格哦

第四次成功

输入:pip install --target=d:\anaconda\lib\site-packages xlwt --upgrade

输出:Collecting xlwt
  Using cached xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
Installing collected packages: xlwt
Successfully installed xlwt-1.3.0

你可能感兴趣的:(python)