pyvips in Docker environment
See original GitHub issueHi there, This issue is related with #76 .
I’ll borrow my previous comments in #76 in below.
Hello @jcupitt , I’m using docker environment and python 3.7. I think I’m suffering similar issues. Can I get a any hint for this issue?
~$ docker exec -it 2b14 /bin/bash
root@2b147d09f5d5:/conduit# pip3.7 install --upgrade pip
Requirement already up-to-date: pip in /usr/local/lib/python3.7/site-packages (19.0.1)
root@2b147d09f5d5:/conduit# pip3.7 install pyvips
Requirement already satisfied: pyvips in /usr/local/lib/python3.7/site-packages (2.1.5)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.7/site-packages (from pyvips) (1.11.5)
Requirement already satisfied: pycparser in /usr/local/lib/python3.7/site-packages (from cffi>=1.0.0->pyvips) (2.19)
root@2b147d09f5d5:/conduit# python3.7
Python 3.7.2 (default, Jan 23 2019, 02:31:57)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyvips/__init__.py", line 19, in <module>
import _libvips
ModuleNotFoundError: No module named '_libvips'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/pyvips/__init__.py", line 69, in <module>
vips_lib = ffi.dlopen(_vips_libname)
File "/usr/local/lib/python3.7/site-packages/cffi/api.py", line 141, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "/usr/local/lib/python3.7/site-packages/cffi/api.py", line 802, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "/usr/local/lib/python3.7/site-packages/cffi/api.py", line 797, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libvips.so.42'
https://github.com/libvips/pyvips/issues/76#issuecomment-459685994 @jcupitt commented Have you installed the libvips library? It looks like it can’t be found by pyvips. If you can’t fix it, please open a new issue and share your Dockerfile.
I think I don’t have libvips in docker environment as you told.
Though I want to download a libvips in docker env, I can not find easy and precise way.
I downloaded libvips in my local linux(ubuntu) env with just command apt install libvips-tools
.
So, Can you please let me know the precise way to download libvips library in docker environment?
By the way, Its my Dockerfile
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /backend
WORKDIR /backend
ADD requirements.txt /backend/
RUN pip install -r requirements.txt
ADD . /backend/
EXPOSE 8000
and requirements.txt
Django==1.9.6
django-extensions==1.6.7
djangorestframework==3.3.3
PyJWT==1.4.0
six==1.10.0
django-cors-headers
psycopg2
Also using docker-compose
backend:
build: .
volumes:
- ./:/conduit
working_dir: /conduit/
command: sh entrypoint.sh
ports:
- 8000:8000
depends_on:
- db
and entrypoint.sh
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
Sorry for my broken english.
Sincerely, Eunsung Sam Koh
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Finally It works!
THANKS @jcupitt 👍
Yes, works for me too. I made you a complete Dockerfile:
https://github.com/jcupitt/docker-builds/tree/master/pyvips-python3
I see:
Then: