构建CLIP-Fields Docker容器时open3d==0.15.2安装失败求助
问题
我正在构建Docker容器以安装CLIP-Fields仓库,安装requirements.txt依赖时,在open3d环节遇到错误:
#0 16.26 ERROR: Could not find a version that satisfies the requirement open3d0.15.2 (from -r requirements.txt (line 31)) (from versions: 0.10.0.0, 0.11.0, 0.11.1, 0.11.2, 0.12.0, 0.13.0)
#0 16.26 ERROR: No matching distribution found for open3d0.15.2 (from -r requirements.txt (line 31))
我的Dockerfile内容如下:
# Use the official PyTorch base image with CUDA support FROM pytorch/pytorch:1.8.1-cuda11.1-cudnn8-runtime # Install system dependencies RUN apt-get update && apt-get install -y git # Clone the CLIP Fields repository RUN git clone CLIP-Fields仓库 /clip-fields WORKDIR /clip-fields # Clone and install the Detic submodule RUN git clone Detic仓库 # Clone and install the LSeg submodule RUN git clone LSeg仓库 # Create a conda environment and activate it. py 3.8 used RUN conda create -n cf python=3.7 && \ echo "conda activate cf" >> ~/.bashrc SHELL ["/bin/bash", "--login", "-c"] # Install dependencies RUN conda install -y pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch-lts -c nvidia RUN pip install -r requirements.txt # Set the working directory to the gridencoder folder WORKDIR /clip-fields/gridencoder # Install the hashgrid encoder with the relevant CUDA module # Update the CUDA_HOME path if necessary ENV CUDA_HOME=/usr/local/cuda RUN python setup.py install # Set the working directory back to the root of the CLIP Fields repository WORKDIR /clip-fields # Run any necessary commands or scripts here # Set the command to run when the container starts CMD ["/bin/bash"]
明明PyPI上存在open3d==0.15.2版本,为何会出现该错误?
解决方案
- Python版本不兼容:open3d 0.15.2最低要求Python 3.8,你创建conda环境时用的是Python 3.7,pip会自动过滤不兼容的版本,因此找不到0.15.2。
- Docker架构不匹配:如果你的Docker运行在arm64架构(比如M系列Mac),open3d 0.15.2可能没有对应架构的预编译包,pip只能找到旧版本的兼容包。
- pip版本过旧:老版本pip无法识别PyPI上的新版本包,尤其是版本号格式有变化的情况。
对应解决步骤:
- 修改conda环境的Python版本为3.8及以上:
RUN conda create -n cf python=3.8 && \ echo "conda activate cf" >> ~/.bashrc - 升级pip到最新版本后再安装依赖,在
pip install -r requirements.txt前添加:RUN pip install --upgrade pip - 如果是架构问题,要么切换到amd64架构构建镜像:
要么尝试从源码编译安装open3d 0.15.2:docker build --platform linux/amd64 -t clip-fields .RUN pip install open3d==0.15.2 --no-binary :all:
内容的提问来源于stack exchange,提问作者Pep Bravo
相关产品推荐
相关产品推荐

