Giter VIP home page Giter VIP logo

Comments (12)

matrey avatar matrey commented on July 19, 2024 1

Good news! No more error on Ubuntu (server) 16.04.1 LTS + libvips 8.2.2-1 (without -dev) / ABI mode

$ pip install --upgrade --no-cache-dir git+git://github.com/jcupitt/pyvips.git@4df6fb5a7b50a6ba540c7fad529df7272c7efe51
Collecting git+git://github.com/jcupitt/pyvips.git@4df6fb5a7b50a6ba540c7fad529df7272c7efe51
  Cloning git://github.com/jcupitt/pyvips.git (to 4df6fb5a7b50a6ba540c7fad529df7272c7efe51) to /tmp/pip-riwrh6b2-build
  Could not find a tag or branch '4df6fb5a7b50a6ba540c7fad529df7272c7efe51', assuming commit.
Collecting cffi>=1.0.0 (from pyvips==2.1.2)
  Downloading cffi-1.11.5-cp35-cp35m-manylinux1_x86_64.whl (420kB)
    100% |████████████████████████████████| 430kB 91kB/s 
Requirement already up-to-date: pycparser in ./.venv/lib/python3.5/site-packages (from cffi>=1.0.0->pyvips==2.1.2)
Installing collected packages: cffi, pyvips
  Found existing installation: cffi 1.10.0
    Uninstalling cffi-1.10.0:
      Successfully uninstalled cffi-1.10.0
  Found existing installation: pyvips 2.1.2
    Uninstalling pyvips-2.1.2:
      Successfully uninstalled pyvips-2.1.2
  Running setup.py install for pyvips ... done
Successfully installed cffi-1.11.5 pyvips-2.1.2
$ pip show pyvips
Name: pyvips
Version: 2.1.2
Summary: binding for the libvips image processing library, ABI mode
...
$ python testvips.py 
DEBUG:pyvips:Binary module load failed: No module named '_libvips'
DEBUG:pyvips:Falling back to ABI mode
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7fe78636e5c0>
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7fe786842eb8>
DEBUG:pyvips:Inited libvips
DEBUG:pyvips:
test Image
DEBUG:pyvips.voperation:VipsOperation.call: operation_name = VipsForeignLoadPng
DEBUG:pyvips.voperation:VipsOperation.call: string_options = 
DEBUG:pyvips.voperation:VipsOperation.call: match_image = None
DEBUG:pyvips.vobject:VipsObject.set: name = filename, value = /REDACTED/pricedrop.png
DEBUG:pyvips.vobject:VipsObject.get: name = out
DEBUG:pyvips.vobject:VipsObject.get: name = width
DEBUG:pyvips.vobject:VipsObject.get: name = height
DEBUG:pyvips.vobject:VipsObject.get: name = format
DEBUG:pyvips.vobject:VipsObject.get: name = bands
DEBUG:pyvips.vobject:VipsObject.get: name = interpretation
DEBUG:pyvips.voperation:VipsOperation.call: result = <pyvips.Image 1812x859 uchar, 4 bands, srgb>
DEBUG:pyvips.vobject:VipsObject.get: name = width
DEBUG:pyvips.vobject:VipsObject.get: name = height
DEBUG:pyvips.vobject:VipsObject.get: name = format
DEBUG:pyvips.vobject:VipsObject.get: name = bands
DEBUG:pyvips.vobject:VipsObject.get: name = interpretation
image = <pyvips.Image 1812x859 uchar, 4 bands, srgb>
DEBUG:pyvips.vobject:VipsObject.get: name = width
image.width = 1812

I also re-checked the other platform just in case.
Ubuntu desktop 17.04, Python 3.5.3, libvips 8.4.5-1build1 (installed libvips, libvips-dev, libvips-tools)

  • with dev headers installed, API mode --> OK
  • after uninstalling the dev headers, ABI mode --> OK

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Huh strange, decls is just part of pyvips:

https://github.com/jcupitt/pyvips/blob/master/pyvips/decls.py

I'll try to investigate.

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

If you have libvips-dev on there, it should work in API mode. Perhaps you have a cached binary wheel for pyvips? You could try deleting that and doing pip install pyvips again.

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Also, which python are you using? It's currently passing with 2.7, 3.5 and 3.6, but failing with 3.3 and 3.4 due to a strange dependency problem.

https://travis-ci.org/jcupitt/pyvips/builds/345887526

from pyvips.

matrey avatar matrey commented on July 19, 2024

I'm using Python 3.5 on both machines, within a virtualenv.
Checking on your remark "Perhaps you have a cached binary wheel for pyvips", I ran:

$ pip install --no-cache-dir pyvips
Collecting pyvips
  Downloading pyvips-2.1.1.tar.gz
Requirement already satisfied: cffi>=1.0.0 in ./.venv/lib/python3.5/site-packages (from pyvips)
Collecting pkgconfig (from pyvips)
  Downloading pkgconfig-1.3.1.tar.gz
Requirement already satisfied: pycparser in ./.venv/lib/python3.5/site-packages (from cffi>=1.0.0->pyvips)
Installing collected packages: pkgconfig, pyvips
  Running setup.py install for pkgconfig ... done
  Running setup.py install for pyvips ... done
Successfully installed pkgconfig-1.3.1 pyvips-2.1.1
$ pip show pyvips
Name: pyvips
Version: 2.1.1
Summary: binding for the libvips image processing library, API mode
Home-page: https://github.com/jcupitt/pyvips
Author: John Cupitt
Author-email: [email protected]
License: MIT
Location: /data/work/storeprint/python/.venv/lib/python3.5/site-packages
Requires: cffi, pkgconfig

This time it seems to report being installed in API mode rather than ABI.
However, this still doesn't help running the sample code (though the error seems a bit different this time):

$ python testpyvips.py 
DEBUG:pyvips:Binary module load failed: /REDACTED/.venv/lib/python3.5/site-packages/_libvips.abi3.so: undefined symbol: vips_image_get_fields
DEBUG:pyvips:Falling back to ABI mode
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7f5f99d7f128>
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7f5f9a24cfd0>
DEBUG:pyvips:Inited libvips
DEBUG:pyvips:
Traceback (most recent call last):
  File "testpyvips.py", line 4, in <module>
    import pyvips
  File "/REDACTED/.venv/lib/python3.5/site-packages/pyvips/__init__.py", line 75, in <module>
    import decls
ImportError: No module named 'decls'

Could it be related to the virtualenv? or to the fact I used "--no-install-recommends" for the libraries (sudo apt-get install libvips libvips-dev libvips-tools --no-install-recommends)?

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Hello again, you've hit another bug, sorry:

https://github.com/jcupitt/pyvips/issues/33

Could you try git master pyvips? That one should be fixed now.

pyvips 2.1 has a big change to the way it installs :-( it seems to be causing trouble.

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Oop, I was reading too quickly, that's a different problem.

I'll have another look at your decls issue.

from pyvips.

matrey avatar matrey commented on July 19, 2024

By the way here are my libvips versions:

  • Ubuntu 16.04.1 LTS, Python 3.5.2 --> libvips 8.2.2-1
  • Ubuntu desktop 17.04, Python 3.5.3 --> libvips 8.4.5-1build1 (installed libvips, libvips-dev, libvips-tools)

Doing the test on the latter (with libvips 8.4.5-1build1), using the most recent commit on master:

$ pip install --no-cache-dir git+git://github.com/jcupitt/pyvips.git@2bcaf01dbed6e7df117be1a004664e918827ee82
Collecting git+git://github.com/jcupitt/pyvips.git@2bcaf01dbed6e7df117be1a004664e918827ee82
  Cloning git://github.com/jcupitt/pyvips.git (to 2bcaf01dbed6e7df117be1a004664e918827ee82) to /tmp/pip-do7k84bu-build
  Could not find a tag or branch '2bcaf01dbed6e7df117be1a004664e918827ee82', assuming commit.
Requirement already satisfied: cffi>=1.0.0 in ./.venv/lib/python3.5/site-packages (from pyvips==2.1.2)
Requirement already satisfied: pkgconfig in ./.venv/lib/python3.5/site-packages (from pyvips==2.1.2)
Requirement already satisfied: pycparser in ./.venv/lib/python3.5/site-packages (from cffi>=1.0.0->pyvips==2.1.2)
Installing collected packages: pyvips
  Found existing installation: pyvips 2.1.1
    Uninstalling pyvips-2.1.1:
      Successfully uninstalled pyvips-2.1.1
  Running setup.py install for pyvips ... done
Successfully installed pyvips-2.1.2
$ pip show pyvips
Name: pyvips
Version: 2.1.2
Summary: binding for the libvips image processing library, API mode
...

Now, it works! No more decls issue.

DEBUG:pyvips:Loaded binary module _libvips
DEBUG:pyvips:Inited libvips
DEBUG:pyvips:
test Image
DEBUG:pyvips.voperation:VipsOperation.call: operation_name = VipsForeignLoadPng
DEBUG:pyvips.voperation:VipsOperation.call: string_options = 
DEBUG:pyvips.voperation:VipsOperation.call: match_image = None
DEBUG:pyvips.vobject:VipsObject.set: name = filename, value = /REDACTED.png
DEBUG:pyvips.vobject:VipsObject.get: name = out
DEBUG:pyvips.vobject:VipsObject.get: name = width
DEBUG:pyvips.vobject:VipsObject.get: name = height
DEBUG:pyvips.vobject:VipsObject.get: name = format
DEBUG:pyvips.vobject:VipsObject.get: name = bands
DEBUG:pyvips.vobject:VipsObject.get: name = interpretation
DEBUG:pyvips.voperation:VipsOperation.call: result = <pyvips.Image 1812x859 uchar, 4 bands, srgb>
DEBUG:pyvips.vobject:VipsObject.get: name = width
DEBUG:pyvips.vobject:VipsObject.get: name = height
DEBUG:pyvips.vobject:VipsObject.get: name = format
DEBUG:pyvips.vobject:VipsObject.get: name = bands
DEBUG:pyvips.vobject:VipsObject.get: name = interpretation
image = <pyvips.Image 1812x859 uchar, 4 bands, srgb>
DEBUG:pyvips.vobject:VipsObject.get: name = width
image.width = 1812

from pyvips.

matrey avatar matrey commented on July 19, 2024

Testing on my other platform: Ubuntu (server) 16.04.1 LTS, Python 3.5.2 --> libvips 8.2.2-1.
On that one I only installed libvips (not -dev) so I'd expect it to use ABI

Installing the same version

$ pip install --no-cache-dir git+git://github.com/jcupitt/pyvips.git@2bcaf01dbed6e7df117be1a004664e918827ee82
Collecting git+git://github.com/jcupitt/pyvips.git@2bcaf01dbed6e7df117be1a004664e918827ee82
  Cloning git://github.com/jcupitt/pyvips.git (to 2bcaf01dbed6e7df117be1a004664e918827ee82) to /tmp/pip-vrkoekaa-build
  Could not find a tag or branch '2bcaf01dbed6e7df117be1a004664e918827ee82', assuming commit.
Requirement already satisfied: cffi>=1.0.0 in ./.venv/lib/python3.5/site-packages (from pyvips==2.1.2)
Requirement already satisfied: pycparser in ./.venv/lib/python3.5/site-packages (from cffi>=1.0.0->pyvips==2.1.2)
Installing collected packages: pyvips
  Found existing installation: pyvips 2.1.1
    Uninstalling pyvips-2.1.1:
      Successfully uninstalled pyvips-2.1.1
  Running setup.py install for pyvips ... done
Successfully installed pyvips-2.1.2
$ pip show pyvips
Name: pyvips
Version: 2.1.2
Summary: binding for the libvips image processing library, ABI mode
...

Now the test...

$ python testvips.py 
DEBUG:pyvips:Binary module load failed: No module named '_libvips'
DEBUG:pyvips:Falling back to ABI mode
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7f4e25ad22e8>
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7f4e25b33f28>
DEBUG:pyvips:Inited libvips
DEBUG:pyvips:
Traceback (most recent call last):
  File "testvips.py", line 4, in <module>
    import pyvips
  File "/REDACTED/.venv/lib/python3.5/site-packages/pyvips/__init__.py", line 75, in <module>
    import decls
ImportError: No module named 'decls'

So the "decls" issue still seems to be happening under these conditions:

  • Ubuntu (server) 16.04.1 LTS
  • Python 3.5.2
  • libvips 8.2.2-1 (and without -dev)
  • pyvips master@2bcaf01dbed6e7df117be1a004664e918827ee82

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Some progress! Thank you for being so patient with this.

Could you try master again? I made decls a relative import, perhaps it'll help.

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Oh dear, that was silly. Try again, it's working for me now.

from pyvips.

jcupitt avatar jcupitt commented on July 19, 2024

Great! I'll merge your PR too. Thank you again for reporting this.

from pyvips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.