I'm executing a python file inside a docker container, and need to import all the functions that I put into a separate python file called base_functions. However, writing from base_functions import * throws the error, that ModuleNotFoundError: No module named 'base_functions', even though base_functions.py is in the same directory as the main python file. How can I do this? Do I need to specify which python scripts I want to import beforehand, in the settings.ini or something?
This is the content of the Dockerfile:
FROM amancevice/pandas:0.24.1-alpine
RUN apk update
RUN apk add build-base
RUN apk add gcc musl-dev libc-dev util-linux-dev linux-headers python3-dev postgresql-libs postgresql-dev git libffi-dev libmemcached-dev zlib-dev \
ca-certificates zlib-dev jpeg-dev freetype-dev libpng
RUN pip3 install --upgrade pip
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY src /vdp
WORKDIR /
ENTRYPOINT ["python3", "-m", "vdp"]
These are all the files in the directory of the project:
/home/cr/docker/71119/.
├── docker-compose.yaml
├── Dockerfile
├── Makefile
├── README.md
├── requirements.txt
├── settings.ini
└── src
├── base_functions.py
├── influx.py
├── __init__.py
└── __main__.py
from .base_functions import *?