୧⍤⃝ ୧⍤⃝ 2023-09-01 21:40 采纳率: 52.5%
浏览 64
已结题

python 安装库和git软件时报错,如何解决?

python 安装库和git软件时报错

 × git clone --filter=blob:none --quiet https://github.com/huggingface/transformers.git 'C:\Users\28636\AppData\Local\Temp\pip-install-6sot6f8y\transformers_60fd74668dd24d0ca03372c93ca870f2' did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/huggingface/transformers.git 'C:\Users\28636\AppData\Local\Temp\pip-install-6sot6f8y\transformers_60fd74668dd24d0ca03372c93ca870f2' did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
  • 写回答

2条回答 默认 最新

  • 项目张雪峰之巅 2023-09-01 23:03
    关注

    这种错误通常是由于网络连接不稳定或源文件找不到等原因引起的。以下是一些可能的解决方法
    感觉上就是错开中美的时间差,你晚上运行的时候,会好一些。

    当然,也有其它的原因。或者是用镜像

    1 检查网络连接是否正常,尝试使用其他网络连接或在网络连接更好的时候重试。

    2 确认你已经正确安装了所需的编译环境和依赖项。例如,在安装某些 Python 库时需要先安装 C 编译器和相关的开发工具包。这些工具包通常在基本的 Linux 发行版上都可以使用系统包管理器安装。

    在安装时指定软件源,例如使用清华大学的软件源,可以尝试以下命令:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

    或者将默认软件源修改为清华镜像站:

    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

    使用 pip 命令的 --proxy 参数指定一个代理服务器,例如:

    pip install --proxy=http://user:password@proxyserver:port some-package

    如果以上方法都无效,可以尝试手动下载对应的库和软件并手动安装。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 9月16日
  • 已采纳回答 9月8日
  • 创建了问题 9月1日