question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building from Dockerfile errors on pip install

See original GitHub issue

Instructions To Reproduce the 🐛 Bug:

  1. Full runnable code or full changes you made: https://github.com/facebookresearch/detectron2/blob/main/docker/Dockerfile#L17
RUN wget https://bootstrap.pypa.io/get-pip.py && \
	python3 get-pip.py --user && \
	rm get-pip.py
  1. What exact command you run: docker build .
  2. Full logs or other relevant observations:
 > [ 7/13] RUN wget https://bootstrap.pypa.io/get-pip.py &&     python3 get-pip.py --user &&    rm get-pip.py:                                                              
#10 0.302 --2022-02-01 11:28:27--  https://bootstrap.pypa.io/get-pip.py                                                                                                     
#10 0.304 Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.36.175, 2a04:4e42:9::175                                                                               
#10 0.342 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.36.175|:443... connected.                                                                             
#10 0.406 HTTP request sent, awaiting response... 200 OK
#10 0.428 Length: 2609829 (2.5M) [text/x-python]
#10 0.429 Saving to: 'get-pip.py'
#10 0.432 
#10 0.432      0K .......... .......... .......... .......... ..........  1% 2.12M 1s
#10 0.452     50K .......... .......... .......... .......... ..........  3% 8.65M 1s
...
#10 0.686   2450K .......... .......... .......... .......... .......... 98% 8.50M 0s
#10 0.691   2500K .......... .......... .......... .......... ........  100% 23.6M=0.3s
#10 0.693 
#10 0.693 2022-02-01 11:28:28 (9.40 MB/s) - 'get-pip.py' saved [2609829/2609829]
#10 0.693 
#10 0.730 ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.
------
executor failed running [/bin/sh -c wget https://bootstrap.pypa.io/get-pip.py &&        python3 get-pip.py --user &&    rm get-pip.py]: exit code: 1

  1. please simplify the steps as much as possible so they do not require additional resources to run, such as a private dataset.
  • Download repository
  • Build from Dockerfile

Possible Fix:

Update the link to download the desired pip version: https://bootstrap.pypa.io/pip/3.6/get-pip.py

Environment:

Local environment from where Docker is executed:

---------------------  -----------------------------------------------------------------------------------------
sys.platform           darwin
Python                 3.7.8 (v3.7.8:4b47a5b6ba, Jun 27 2020, 04:47:50) [Clang 6.0 (clang-600.0.57)]
numpy                  1.19.3
detectron2             0.6 @/Users/bertleroy/git/detectron-model/venv/src/detectron2/detectron2
Compiler               clang 11.0.3
CUDA compiler          not available
DETECTRON2_ENV_MODULE  <not set>
PyTorch                1.9.0 @/Users/bertleroy/git/detectron-model/venv/lib/python3.7/site-packages/torch
PyTorch debug build    False
GPU available          No: torch.cuda.is_available() == False
Pillow                 8.0.1
torchvision            0.10.0 @/Users/bertleroy/git/detectron-model/venv/lib/python3.7/site-packages/torchvision
fvcore                 0.1.5.post20220119
iopath                 0.1.9
cv2                    4.2.0
---------------------  -----------------------------------------------------------------------------------------
PyTorch built with:
  - GCC 4.2
  - C++ Version: 201402
  - clang 12.0.0
  - Intel(R) Math Kernel Library Version 2020.0.1 Product Build 20200208 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CXX_COMPILER=/Applications/Xcode-12.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wno-invalid-partial-specialization -Wno-typedef-redefinition -Wno-unknown-warning-option -Wno-unused-private-field -Wno-inconsistent-missing-override -Wno-aligned-allocation-unavailable -Wno-c++14-extensions -Wno-constexpr-not-const -Wno-missing-braces -Qunused-arguments -fcolor-diagnostics -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-unused-private-field -Wno-missing-braces -Wno-c++14-extensions -Wno-constexpr-not-const, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=OFF, 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
apd2599commented, Jul 5, 2022

Hey,

I ran the DockerFile with the updated lines, but a similar error appears when the file runs the command ERROR [12/13] RUN pip install --user -e detectron2_repo.

#15 19.10 ERROR: Package ‘detectron2’ requires a different Python: 3.6.9 not in ‘>=3.7’

executor failed running [/bin/sh -c pip install --user -e detectron2_repo]: exit code: 1

Any suggestions?

1reaction
farukcankayacommented, Jul 16, 2022

I posted two solutions that worked for me here: https://github.com/facebookresearch/detectron2/issues/4394#issuecomment-1186037669 it might help you, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install fails on docker build - python - Stack Overflow
I have following Dockerfile : FROM openjdk:8-jre-alpine3. 8 WORKDIR /app RUN apk --no-cache add curl bash g++ postgresql-dev python3-dev COPY ...
Read more >
Dockerfile Error RUN pip install -r requirements.txt - General
Hi , i am pretty new for docker, I just try to write a docker file for a python flask web app. but...
Read more >
Is it better to pip install packages in the Dockerfile ... - Quora
From there error message, it looks like you are extending a windows image. E: Unable to locate package python-pip. So I would suggest...
Read more >
Installing Python Packages In Your Docker Container
Check your Docker hub profile and click on your spacy image. You will see a conda and pip tag under tags. pip is...
Read more >
Docker build getting errors after I tried to install pip install
[Solved]-Docker build getting errors after I tried to install pip install -r requirements.txt file-docker ... The error could be caused by the wrong...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found