Skip to content

Commit 5c80537

Browse files
authored
opencv-python support TPU VM
Fixing a bug where import cv2 on TPU VM wouldn't work.
1 parent bacb6e6 commit 5c80537

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tpu/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ ADD patches/kaggle_datasets.py /root/.local/lib/${PYTHON_VERSION_PATH}/site-pack
3838
# sitecustomize adds significant latency to ipython kernel startup and should only be added if needed
3939
# ADD patches/sitecustomize.py /root/.local/lib/${PYTHON_VERSION_PATH}/site-packages/sitecustomize.py
4040

41+
# Prereqs
42+
# This is needed for cv2 (opencv-python):
43+
# https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
44+
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
45+
4146
# Install all the packages together for maximum compatibility.
4247

4348
# Install Tensorflow.

0 commit comments

Comments
 (0)