美文网首页
pycharm中安装第三方库

pycharm中安装第三方库

作者: 淆曌 | 来源:发表于2020-05-05 01:09 被阅读0次

    1、如何添加第三方库,如beautiful soup4、request等?

    方法一:直接在pycharm中添加(最方便的办法)

    File --> Settings -->Python Interpreter 

    搜索库 安装库

    方法二:通过cmd(命令提示符)安装

    打开cmd:点击开始,输入“cmd”选择“命令提示符”,或者win+R直接打开。

    输入pip install +需要安装的库名,以安装requests为例:

    输入 pip install requests

    运行

    出现 successfully installed则安装成功。

    如果需要看已经安装的库,可以在cmd中输入 pip list,就可以。

    2、安装中遇到的问题:

    1、read timed out

    read timed out

    出现原因:国外服务器,响应慢,读取时间长

    解决方法:

    1、在cmd中安装,输入python -m pip --default-timeout=100 install python库名称

    2、切换下载源

    常用pip的镜像路径有:

    中国科技大学

    pip install 包名 -i https://pypi.mirrors.ustc.edu.cn/simple/

    加利福利亚大学

    pip install 包名 -i https://www.lfd.uci.edu/~gohlke/pythonlibs/

    相关文章

      网友评论

          本文标题:pycharm中安装第三方库

          本文链接:https://www.haomeiwen.com/subject/wtqpghtx.html