Skip to content

Instantly share code, notes, and snippets.

@rtkaleta
Last active October 14, 2018 18:22
Show Gist options
  • Save rtkaleta/004fc4be28ee20c23aec882eb97221fe to your computer and use it in GitHub Desktop.
Save rtkaleta/004fc4be28ee20c23aec882eb97221fe to your computer and use it in GitHub Desktop.
Installing dlib, OpenCV and tesseract-ocr for Python2 on Trusty
FROM ubuntu:14.04
RUN apt-get update -y && \
apt-get install -y build-essential && \
apt-get install -y python2.7 python-dev python-pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && \
set -eu
RUN apt-get install -y cmake # Needed to install dlib
RUN apt-get install -y tesseract-ocr libtesseract-dev libleptonica-dev # Needed for pytesseract
RUN apt-get install -y libglib2.0-0 # Needed for cv2/matplotlib
RUN pip install --upgrade pip setuptools
RUN pip install dlib==19.9.0 # Takes a while so run as separate step in case error follows
RUN pip install Pillow==4.2.1 opencv-python==3.3.0.9
RUN pip install pytesseract==0.1.6
RUN python -c "import dlib;import cv2;import pytesseract;print dir(dlib)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment