博客园 首页 私信博主 回到顶部 联系博主
(仅pc端)
管理 换背景图

pip使用经验

pip install

情况1.没有pip这种情况只会发生在linux上,如果您是MacOS或者Windows请跳过此情况。

如果您出现了这种情况,会出现这样的错误代码:bash: pip: command not found... 这样,只需要安装pip,输入命令:wget https://bootstrap.pypa.io/get-pip.pypython3 get-pip.py就可以成功使用pip install了。

情况2.PATH目录错误如果出现这种情况,您一定是在Windows系统下的,如果您是Linux或者MacOS可以跳过。

您只需要把Python编辑到PATH里面就可以了。首先,右键我的电脑,点击属性,点击高级系统设置,点击环境变量,在窗口下方系统变量找到PATH,点击PATH再点击编辑,输入Python安装目录,就可以实现pip install了。

情况3.下载请求超时这种情况会发生在所有系统上。

如果您出现这种情况,可以有3种方法解决。

方法1.增加超时时间输入命令:pip --default-timeout=100 install xx
方法2.不使用缓存pip --no-cache-dir install xx
方法3.使用国内镜像源pip install xx -i http://pypi.douban.com/simple --trusted-host (pypi.douban.com)
获取ssh证书--trusted-host (pypi.douban.com)

pypi.douban.com镜像源可以更改,例如:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

情况4.没有安装依赖库

安装对应依赖库

posted @ 2020-12-01 15:36  温一壶白开  阅读(107)  评论(0编辑  收藏  举报