Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems pip installing pyvips 2.1.1 #33

Closed
rebkwok opened this issue Mar 1, 2018 · 5 comments
Closed

Problems pip installing pyvips 2.1.1 #33

rebkwok opened this issue Mar 1, 2018 · 5 comments

Comments

@rebkwok
Copy link

rebkwok commented Mar 1, 2018

My install does:

sudo apt-get install libvips libvips-dev
pip install pyvips 

A week ago this worked fine, and installed pyvips version 2.0.5 (libvips version 8.2.2-1) (Ubuntu 16.04, python 3.6)
However, now it is failing to install pyvips:

  copying pyvips/voperation.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/enums.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/gvalue.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/vobject.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/version.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/base.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/decls.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/vimage.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    copying pyvips/gobject.py -> build/lib.linux-x86_64-3.6/pyvips\n'
 '    running build_ext\n'
 "    generating cffi module 'build/temp.linux-x86_64-3.6/_libvips.c'\n"
 '    creating build/temp.linux-x86_64-3.6\n'
 "    building '_libvips' extension\n"
 '    creating build/temp.linux-x86_64-3.6/build\n'
 '    creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6\n'
 '    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong '
 '-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DMAGICKCORE_HDRI_ENABLE=0 '
 '-DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libgsf-1 '
 '-I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 '
 '-I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/orc-0.4 '
 '-I/usr/include/OpenEXR -I/usr/include/openslide -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include '
 '-I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 '
 '-I/usr/include/x86_64-linux-gnu -I/usr/include/libpng12 -I/usr/include/libexif -I/usr/include/glib-2.0 '
 '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/python3.6m -I/xx/venv/include/python3.6m -c '
 'build/temp.linux-x86_64-3.6/_libvips.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libvips.o\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_d_vips_image_get_fields’:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:2795:10: warning: implicit declaration of function '
 '‘vips_image_get_fields’ [-Wimplicit-function-declaration]\n'
 '       return vips_image_get_fields(x0);\n'
 '              ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:2795:10: warning: return makes pointer from integer without a cast '
 '[-Wint-conversion]\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_f_vips_image_get_fields’:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:2818:12: warning: assignment makes pointer from integer without a cast '
 '[-Wint-conversion]\n'
 '       { result = vips_image_get_fields(x0); }\n'
 '                ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_checkfld__GValue’:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4569:25: warning: initialization from incompatible pointer type '
 '[-Wincompatible-pointer-types]\n'
 '       { uint64_t(*tmp)[2] = &p->data; (void)tmp; }\n'
 '                             ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_checkfld__VipsImage’:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4609:25: error: ‘VipsImage {aka struct _VipsImage}’ has no member named '
 '‘parent_instance’\n'
 '       { VipsObject *tmp = &p->parent_instance; (void)tmp; }\n'
 '                             ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_checkfld__VipsObject’:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4627:22: error: ‘VipsObject {aka struct _VipsObject}’ has no member named '
 '‘parent_instance’\n'
 '       { GObject *tmp = &p->parent_instance; (void)tmp; }\n'
 '                          ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4630:19: warning: initialization from incompatible pointer type '
 '[-Wincompatible-pointer-types]\n'
 '       { void * *tmp = &p->argument_table; (void)tmp; }\n'
 '                       ^\n'
 '    In file included from /usr/include/sched.h:28:0,\n'
 '                     from /usr/include/pthread.h:23,\n'
 '                     from /usr/include/glib-2.0/glib/deprecated/gthread.h:128,\n'
 '                     from /usr/include/glib-2.0/glib.h:107,\n'
 '                     from /usr/include/vips/vips.h:85,\n'
 '                     from build/temp.linux-x86_64-3.6/_libvips.c:493:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: At top level:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4816:24: error: ‘VipsImage {aka struct _VipsImage}’ has no member named '
 '‘parent_instance’\n'
 '       { "parent_instance", offsetof(VipsImage, parent_instance),\n'
 '                            ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4817:47: error: ‘VipsImage {aka struct _VipsImage}’ has no member named '
 '‘parent_instance’\n'
 '                            sizeof(((VipsImage *)0)->parent_instance),\n'
 '                                                   ^\n'
 '    In file included from /usr/include/sched.h:28:0,\n'
 '                     from /usr/include/pthread.h:23,\n'
 '                     from /usr/include/glib-2.0/glib/deprecated/gthread.h:128,\n'
 '                     from /usr/include/glib-2.0/glib.h:107,\n'
 '                     from /usr/include/vips/vips.h:85,\n'
 '                     from build/temp.linux-x86_64-3.6/_libvips.c:493:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4822:24: error: ‘VipsObject {aka struct _VipsObject}’ has no member named '
 '‘parent_instance’\n'
 '       { "parent_instance", offsetof(VipsObject, parent_instance),\n'
 '                            ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4823:48: error: ‘VipsObject {aka struct _VipsObject}’ has no member named '
 '‘parent_instance’\n'
 '                            sizeof(((VipsObject *)0)->parent_instance),\n'
 '                                                    ^\n'
 "    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n"
 '    \n'
 '    ----------------------------------------\n'
 '\n'
 ':stderr:   Failed building wheel for pyvips\n'
 'Command "/xx/venv/bin/python3.6 -u -c "import setuptools, '
 "tokenize;__file__='/tmp/pip-build-mi3al6kr/pyvips/setup.py';f=getattr(tokenize, 'open', "
 'open)(__file__);code=f.read().replace(\'\\r\\n\', \'\\n\');f.close();exec(compile(code, __file__, \'exec\'))" '
 'install --record /tmp/pip-cm6ibh4v-record/install-record.txt --single-version-externally-managed --compile '
 '--install-headers /xx/venv/include/site/python3.6/pyvips" failed with error code 1 in '
 '/tmp/pip-build-mi3al6kr/pyvips/\n')

In [33]: logfile = 'output.txt'

In [34]: pp.pprint(msg, logfile)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-34-9ce2d8690c0f> in <module>()
----> 1 pp.pprint(msg, logfile)

TypeError: pprint() takes 2 positional arguments but 3 were given

In [35]: pp.pprint(msg, stream=logfile)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-35-388d0498a1f3> in <module>()
----> 1 pp.pprint(msg, stream=logfile)

TypeError: pprint() got an unexpected keyword argument 'stream'

In [36]: with open("output.txt", "w") as fout:
    ...:     pprint(msg, fout)
    ...:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-36-3ac17316ab0b> in <module>()
      1 with open("output.txt", "w") as fout:
----> 2     pprint(msg, fout)
      3

TypeError: 'module' object is not callable

In [37]: os.path.exists(logfile)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-37-6ecdaa4b77dc> in <module>()
----> 1 os.path.exists(logfile)

NameError: name 'os' is not defined

 '                          ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4630:19: warning: initialization '
 'from incompatible pointer type [-Wincompatible-pointer-types]\n'
 '       { void * *tmp = &p->argument_table; (void)tmp; }\n'
 '                       ^\n'
 '    In file included from /usr/include/sched.h:28:0,\n'
 '                     from /usr/include/pthread.h:23,\n'
 '                     from '
 '/usr/include/glib-2.0/glib/deprecated/gthread.h:128,\n'
 '                     from /usr/include/glib-2.0/glib.h:107,\n'
 '                     from /usr/include/vips/vips.h:85,\n'
 '                     from build/temp.linux-x86_64-3.6/_libvips.c:493:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c: At top level:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4816:24: error: ‘VipsImage {aka '
 'struct _VipsImage}’ has no member named ‘parent_instance’\n'
 '       { "parent_instance", offsetof(VipsImage, parent_instance),\n'
 '                            ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4817:47: error: ‘VipsImage {aka '
 'struct _VipsImage}’ has no member named ‘parent_instance’\n'
 '                            sizeof(((VipsImage *)0)->parent_instance),\n'
 '                                                   ^\n'
 '    In file included from /usr/include/sched.h:28:0,\n'
 '                     from /usr/include/pthread.h:23,\n'
 '                     from '
 '/usr/include/glib-2.0/glib/deprecated/gthread.h:128,\n'
 '                     from /usr/include/glib-2.0/glib.h:107,\n'
 '                     from /usr/include/vips/vips.h:85,\n'
 '                     from build/temp.linux-x86_64-3.6/_libvips.c:493:\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4822:24: error: ‘VipsObject {aka '
 'struct _VipsObject}’ has no member named ‘parent_instance’\n'
 '       { "parent_instance", offsetof(VipsObject, parent_instance),\n'
 '                            ^\n'
 '    build/temp.linux-x86_64-3.6/_libvips.c:4823:48: error: ‘VipsObject {aka '
 'struct _VipsObject}’ has no member named ‘parent_instance’\n'
 '                            sizeof(((VipsObject *)0)->parent_instance),\n'
 '                                                    ^\n'
 "    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n"
 '    \n'
 '    ----------------------------------------\n'
 '\n'
 ':stderr:   Failed building wheel for pyvips\n'
 'Command "/xx/venv/bin/python3.6 -u -c "import setuptools, '
 "tokenize;__file__='/tmp/pip-build-mi3al6kr/pyvips/setup.py';f=getattr(tokenize, "
 "'open', open)(__file__);code=f.read().replace('\\r\\n', "
 '\'\\n\');f.close();exec(compile(code, __file__, \'exec\'))" install --record '
 '/tmp/pip-cm6ibh4v-record/install-record.txt '
 '--single-version-externally-managed --compile --install-headers '
 '/xx/venv/include/site/python3.6/pyvips" failed with error code 1 in '
 '/tmp/pip-build-mi3al6kr/pyvips/\n'

My libvips/libvips-dev versions are still 8.2.2-1, but the latest pypi pyvips version is 2.1.0. pip install pyvips==2.0.5 works fine.

The docs still say that pyvips just needs libvips > 8.2. Does the latest version of pyvips actually require a later version of libvips than 8.2.2-1 (which is the latest 16.04 debian package)

jcupitt referenced this issue Mar 1, 2018
only use vips_image_get_fields() on 8.5 and later

thanks rebkwok

see: https://github.com/jcupitt/pyvips/issues/33
@jcupitt
Copy link
Member

jcupitt commented Mar 1, 2018

Hello @rebkwok,

Thanks for reporting this -- it was using vips_image_get_fields(), a feature only added in libvips 8.5. This used to work, since in ABI mode references are only looked up when they are used. In API mode (the new default in 2.1), all references are compiled at install time, so the undefined ref makes install fail.

git master pyvips now tests the libvips version number before attempting to wrap vips_image_get_fields(). Would you be able to test it? Just clone the repo and install from there.

@rebkwok
Copy link
Author

rebkwok commented Mar 1, 2018

I tried installing from the latest commit on master

pip install git+git://github.com/jcupitt/pyvips.git@bc35d3c12f71db49bbf37cddb09dc8b5d9b79b16

But similar errors (although no reference to vips_image_get_fields() that I can see):

Collecting git+git://github.com/jcupitt/pyvips.git@bc35d3c12f71db49bbf37cddb09dc8b5d9b79b16
  Cloning git://github.com/jcupitt/pyvips.git (to bc35d3c12f71db49bbf37cddb09dc8b5d9b79b16) to /tmp/pip-wj65t_ha-build
  Could not find a tag or branch 'bc35d3c12f71db49bbf37cddb09dc8b5d9b79b16', assuming commit.
Collecting cffi>=1.0.0 (from pyvips==2.1.2)
  Using cached cffi-1.11.5-cp36-cp36m-manylinux1_x86_64.whl
Collecting pkgconfig (from pyvips==2.1.2)
Collecting pycparser (from cffi>=1.0.0->pyvips==2.1.2)
Installing collected packages: pycparser, cffi, pkgconfig, pyvips
  Running setup.py install for pyvips ... error
    Complete output from command /.virtualenvs/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-wj65t_ha-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mezy41dz-record/install-record.txt --single-version-externally-managed --compile --install-headers /.virtualenvs/venv/include/site/python3.6/pyvips:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/pyvips_build.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/voperation.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/gobject.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/enums.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/vobject.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/gvalue.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/vimage.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/error.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/__init__.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/base.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/version.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/decls.py -> build/lib.linux-x86_64-3.6/pyvips
    copying pyvips/vinterpolate.py -> build/lib.linux-x86_64-3.6/pyvips
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-3.6/_libvips.c'
    creating build/temp.linux-x86_64-3.6
    building '_libvips' extension
    creating build/temp.linux-x86_64-3.6/build
    creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libgsf-1 -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/orc-0.4 -I/usr/include/OpenEXR -I/usr/include/openslide -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu -I/usr/include/libpng12 -I/usr/include/libexif -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/python3.6m -I/.virtualenvs/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/_libvips.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libvips.o
    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_checkfld__GValue’:
    build/temp.linux-x86_64-3.6/_libvips.c:4529:25: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
       { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
                             ^
    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_checkfld__VipsImage’:
    build/temp.linux-x86_64-3.6/_libvips.c:4569:25: error: ‘VipsImage {aka struct _VipsImage}’ has no member named ‘parent_instance’
       { VipsObject *tmp = &p->parent_instance; (void)tmp; }
                             ^
    build/temp.linux-x86_64-3.6/_libvips.c: In function ‘_cffi_checkfld__VipsObject’:
    build/temp.linux-x86_64-3.6/_libvips.c:4587:22: error: ‘VipsObject {aka struct _VipsObject}’ has no member named ‘parent_instance’
       { GObject *tmp = &p->parent_instance; (void)tmp; }
                          ^
    build/temp.linux-x86_64-3.6/_libvips.c:4590:19: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
       { void * *tmp = &p->argument_table; (void)tmp; }
                       ^
    In file included from /usr/include/sched.h:28:0,
                     from /usr/include/pthread.h:23,
                     from /usr/include/glib-2.0/glib/deprecated/gthread.h:128,
                     from /usr/include/glib-2.0/glib.h:107,
                     from /usr/include/vips/vips.h:85,
                     from build/temp.linux-x86_64-3.6/_libvips.c:493:
    build/temp.linux-x86_64-3.6/_libvips.c: At top level:
    build/temp.linux-x86_64-3.6/_libvips.c:4775:24: error: ‘VipsImage {aka struct _VipsImage}’ has no member named ‘parent_instance’
       { "parent_instance", offsetof(VipsImage, parent_instance),
                            ^
    build/temp.linux-x86_64-3.6/_libvips.c:4776:47: error: ‘VipsImage {aka struct _VipsImage}’ has no member named ‘parent_instance’
                            sizeof(((VipsImage *)0)->parent_instance),
                                                   ^
    In file included from /usr/include/sched.h:28:0,
                     from /usr/include/pthread.h:23,
                     from /usr/include/glib-2.0/glib/deprecated/gthread.h:128,
                     from /usr/include/glib-2.0/glib.h:107,
                     from /usr/include/vips/vips.h:85,
                     from build/temp.linux-x86_64-3.6/_libvips.c:493:
    build/temp.linux-x86_64-3.6/_libvips.c:4781:24: error: ‘VipsObject {aka struct _VipsObject}’ has no member named ‘parent_instance’
       { "parent_instance", offsetof(VipsObject, parent_instance),
                            ^
    build/temp.linux-x86_64-3.6/_libvips.c:4782:48: error: ‘VipsObject {aka struct _VipsObject}’ has no member named ‘parent_instance’
                            sizeof(((VipsObject *)0)->parent_instance),
                                                    ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/.virtualenvs/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-wj65t_ha-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mezy41dz-record/install-record.txt --single-version-externally-managed --compile --install-headers /.virtualenvs/venv/include/site/python3.6/pyvips" failed with error code 1 in /tmp/pip-wj65t_ha-build/```

jcupitt referenced this issue Mar 1, 2018
there was a ref to parent_instance, which did not exist before libvips
8.4

see https://github.com/jcupitt/pyvips/issues/33
@jcupitt
Copy link
Member

jcupitt commented Mar 1, 2018

OK, fixed that too. Could you try again?

I built and installed libvips 8.2 and it now works for me here.

@rebkwok
Copy link
Author

rebkwok commented Mar 1, 2018

👍 All looking good here too. Thanks for the quick fix!

@jcupitt
Copy link
Member

jcupitt commented Mar 1, 2018

woo, I'll push out an update. Thanks again!

@jcupitt jcupitt closed this as completed Mar 1, 2018
matrey added a commit to matrey/pyvips that referenced this issue Mar 2, 2018
jcupitt added a commit that referenced this issue Mar 2, 2018
Add a few notes following #32 and #33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants