You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Colab中安装pix2pix-tensorflow?两种安装方式均失败

无法安装pix2pix-tensorflow的问题与解决

问题情况

尝试了以下两种pip安装命令:

  • !pip install -q pix2pix-tensorflow
  • !pip install git+https://github.com/affinelayer/pix2pix-tensorflow.git

均安装失败,报错信息如下:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting git+https://github.com/affinelayer/pix2pix-tensorflow
Cloning https://github.com/affinelayer/pix2pix-tensorflow to /tmp/pip-req-build-r59bl6ax
Running command git clone -q https://github.com/affinelayer/pix2pix-tensorflow /tmp/pip-req-build-r59bl6ax
ERROR: File "setup.py" not found for legacy project git+https://github.com/affinelayer/pix2pix-tensorflow.

解决方法

这个仓库没有配置setup.py或现代Python包所需的构建文件,无法通过pip直接安装。正确使用步骤:

  1. 克隆仓库到当前环境:
    !git clone https://github.com/affinelayer/pix2pix-tensorflow.git
    
  2. 进入仓库目录:
    %cd pix2pix-tensorflow
    
  3. 直接运行仓库内的脚本(如训练、推理脚本)即可,无需执行安装操作。

另外PyPI上的pix2pix-tensorflow包已停止维护,因此直接pip安装也会失败,建议优先使用仓库源码。

内容的提问来源于stack exchange,提问作者MiltaruyOne

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.26 04:15:28