Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view
I have run the docker server ver.7.2  and it works, but I would like add more python libraries, for example matplotlib to python-server-docker_knowagepython container. I have added the line in python dockerfile

&& pip install  matplotlib==3.3.3 \

but  it doesn't work, the container still only has  basic libraries set in reqirements.txt file.

Please any suggestion ?
Environment Knowage-server-docker 7.2
in Docker by (290 points)

Hi,

i've tried to build the image adding your line like:

...
RUN apt-get update \
        && apt-get install --no-install-recommends -y xmlstarlet \
        && rm -rf /var/lib/apt/lists/* \
        && pip install gunicorn==20.0.4 \
        && pip install -r requirements.txt \
        && pip install matplotlib==3.3.3
...

And i've built it with:

docker build -t my-knowage-python-docker . --build-arg KNOWAGE_APP_BRANCH=master

And finally I've ran:

docker run -ti --rm --entrypoint sh my-knowage-python-docker -c "pip freeze"

And I was able to see matplotlib correctly installed:

[user@host]$ docker run -ti --rm --entrypoint sh my-knowage-python-docker -c "pip freeze"
WARNING: The directory '/home/knowage/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
bokeh==1.3.4
certifi==2020.12.5
chardet==3.0.4
click==7.1.2
cycler==0.10.0
Flask==1.1.1
Flask-Cors==3.0.8
gunicorn==20.0.4
idna==2.8
itsdangerous==1.1.0
Jinja2==2.11.2
kiwisolver==1.3.1
MarkupSafe==1.1.1
matplotlib==3.3.3
numpy==1.19.4
packaging==20.7
pandas==0.25.1
Pillow==8.0.1
pybase64==1.0.1
PyJWT==1.7.1
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2020.4
PyYAML==5.3.1
requests==2.22.0
six==1.15.0
tornado==6.0.3
urllib3==1.25.11
Werkzeug==1.0.1

Could you confirm to me that you followed those steps to build your custom image?

Hi,

Thank you very much, it works exactly as you have written above. I could pre-build the  knowage-python image and using docker compose together  with knowage server  run my knowage-python with few extra python libraries, for example  mysql-connector-python library to access MySQL.

M.

Please log in or register to answer this question.

...