如何在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直接安装。正确使用步骤:
- 克隆仓库到当前环境:
!git clone https://github.com/affinelayer/pix2pix-tensorflow.git - 进入仓库目录:
%cd pix2pix-tensorflow - 直接运行仓库内的脚本(如训练、推理脚本)即可,无需执行安装操作。
另外PyPI上的pix2pix-tensorflow包已停止维护,因此直接pip安装也会失败,建议优先使用仓库源码。
内容的提问来源于stack exchange,提问作者MiltaruyOne
相关产品推荐
相关产品推荐

