Python Dockerfile_Django REST_错误_无法卸载';六个;。这是一个安装的distutils
Docker Django REST API生成因错误而暂停Python Dockerfile_Django REST_错误_无法卸载';六个;。这是一个安装的distutils,python,django,docker,dockerfile,Python,Django,Docker,Dockerfile,Docker Django REST API生成因错误而暂停 Cannot uninstall 'six'. 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. 已在此处更新完整的堆栈跟踪/日志- 我的Dockerfile- # FROM ubuntu:
Cannot uninstall 'six'. 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.
已在此处更新完整的堆栈跟踪/日志-
我的Dockerfile-
#
FROM ubuntu:xenial
RUN apt-get update
RUN apt-get install -y python3 # install python3
RUN apt-get install -y python-pip python-dev build-essential
# Make and Change to DIR - dck1 (MKDIR + WORKDIR)
#
COPY ./REST_CV /usr/src/rest_api/
WORKDIR /usr/src/rest_api/
#
RUN ls
#
RUN pwd
# Docker has default "sh" Shell and Conda prefers a "bash" shell
#
#RUN ["/bin/bash", "-c", " git clone https://github.com/digital-cognition-co-in/Statistical-Model-Management-Framework"]
# Above for Testing only
# Install CURL
RUN apt-get install -y --no-install-recommends vim nano git wget curl
# Install miniconda to /miniconda
RUN curl -LO http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
RUN bash Miniconda-latest-Linux-x86_64.sh -p /miniconda -b
RUN ls ## Will Show file == Miniconda-latest-Linux-x86_64.sh
RUN rm Miniconda-latest-Linux-x86_64.sh
RUN ls ## To check we have removed file == Miniconda-latest-Linux-x86_64.sh
ENV PATH=/miniconda/bin:${PATH}
RUN conda update -y conda
#
#
RUN ["/bin/bash", "-c", "conda create -n docker_opencv_venv python=3.5"]
RUN ["/bin/bash", "-c", "source activate docker_opencv_venv"]
#
#COPY ./requirements.txt /usr/src/rest_api/requirements.txt ## If we want to Copy only a Single File
#
#RUN find requirements.txt ## If we want to "find" a file within same DIR
#
#RUN pip install --no-cache-dir -r requirements.txt
### We want the PACKAGES to be CACHED on the Docker DIR
#
RUN pip install --upgrade pip
RUN pip install -r /usr/src/rest_api/requirements.txt
#
EXPOSE 8000
#
RUN ls
RUN pwd
#
CMD ["python", "manage.py", "migrate"]
#
# Error --- python: can't open file 'manage.py': [Errno 2] No such file or directory
#
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
#
如Jerin所问,我在上面发布了我的Dockerfile 发布您的Dockerfile/docker compose文件Hey Jerin-添加了我的Dockerfile-也对您的评论进行了投票-感谢代替
运行pip安装-r/usr/src/rest\u api/requirements.txt
和运行pip安装-r/usr/src/rest\u api/requirements.txt--忽略已安装的六个
。我想这会解决问题的。有更新吗@RohitUpdate-在DOCKER映像中安装CONDA VENV时-要运行Django的自定义Env,请确保在requirements.txt文件中不包含与创建CONDA VENV时默认安装的包相同的包@罗伊萨卡拉