Python pip的一些问题

pip升级与使用

安装库的时候报了个错,提示要更新pip,之后pip就不能用了:ModuleNotFoundError: No module named 'pip'

第一条命令修复pip, 第二条升级pip

python -m ensurepip
python -m pip install --upgrade pip

错误:

无法卸载“ruamel yaml”。这是一个distutils安装的项目,因此我们无法准确地确定哪些文件属于它,这将导致只部分卸载。

ERROR: Cannot uninstall 'ruamel-yaml'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

pip install xxx  --ignore-installed 库名
或
pip install xxx  --ignore-installed ${PACKAGE_NAME}

WARNING: You are using pip version 19.2.3, however version 21.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

运行
python -m pip install --upgrade pip
后还是报错,运行
easy_install -U pip

其他

查看安装包版本:

pip show xxx

在线下载命令
pip install -i https://pypi.douban.com/simple  scrapy

 

常用的python 镜像
豆瓣
该网站比较稳定,速度也比较快
https://pypi.douban.com/simple

加利福尼亚大学
https://www.lfd.uci.edu/~gohlke/pythonlibs/

清华大学
https://pypi.tuna.tsinghua.edu.cn/simple

中国科技大学
https://mirrors.ustc.edu.cn/pypi/web/simple

阿里
https://mirrors.aliyun.com/pypi/simple/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

瑶山

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值