0

I would like to install This software called Brat on my Ubuntu-based machine except that Brat requires Debian and I didn't manage to install it on Ubuntu. I thought I could go through a Docker container, for that, I wrote the following Dockerfile where I included the necessary libraries for the software

FROM debian:8
WORKDIR /home
COPY . /home

RUN apt-get update && apt install -y curl libgdal-dev libspatialindex-dev libxerces-c-dev \
    libxrandr-dev xsdcxx libegl1-mesa libproj-dev libgeos-c1\
    rsync libsm6 libglu1 libqt5x11extras5 

RUN chmod +x brat-4.2.0-x86_64-installer.run

I built an image based on the Dockerfile and then I installed the software manually (because it contains yes/no questions) inside a Docker container (created from the built image) using: ./brat-4.2.0-x86_64-installer.run. I committed the image and launched the software form my localhost terminal using the following command docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix new_brat_debian /usr/local/bin/brat where new_brat_debian is the name of the committed image. The software was launched successfully and the GUI window appeared except that I had an error asking for the Numpy library to be installed so that the software could function properly. I tried installing Python3 on Debian and followed every way I could find but without success. At this point I don't know how to fix this issue, I thought about doing docker multi-stage building with new_brat_debian and a Python-built image but I don't know if it's worth the adventure. Does anyone have an idea or a suggestion on how to include Python in the existing Docker image? Many thanks in advance.

mja
  • 13
  • 5

1 Answers1

0

Try with latest debian

FROM debian:latest

It's installing python 3.4 and numpy gives error that it requires more than 3.7.

Or

Following worked

FROM debian:8

RUN apt-get update && apt-get -y upgrade

RUN apt-get install -y apt-utils python3 python3-pip python3-numpy

RUN pip3 -V

RUN pip3 show numpy
Prithvi Singh
  • 50
  • 1
  • 5
  • Thanks for your answer @PrithviSingh ! The thing is Brat is built on Debian:8, wouldn't Debian latest be an issue for the software? – mja Sep 09 '21 at 17:39
  • Thanks @PrithviSingh the first suggestion didn't work because of incompatibilities between the libraries and the latest version of Debian. The second suggestion worked and I have python3 and numpy installed in my docker container, thank you very much! – mja Sep 12 '21 at 12:03
  • When I launch the software I still get this error though: `File "/usr/local/bin/Python/BratAlgorithm-Example_AlgoUsingNumpy.py", line 42, in import numpy as np ImportError: No module named 'numpy' Exception caught loading python algorithm in /usr/local/bin/Python/BratAlgorithm-Example_AlgoUsingNumpy.py with class Example_AlgoUsingNumpy: Error loading Python module.` and when I run the file that causes the error independently it runs without problems. What could be the origin of this error in your opinion? Thanks – mja Sep 12 '21 at 12:06