question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: No module named 'decls'

See original GitHub issue

Hi

I get the following error when importing pyvips:

$ 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 0x7fd20b984278>
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7fd20b9e1eb8>
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'

I tried on 2 machines with the same result:

  • Ubuntu 16.04.1 LTS, Python 3.5.2
  • Ubuntu 17.04, Python 3.5.3

I ran sudo apt-get install libvips libvips-dev libvips-tools --no-install-recommends Then in my virtualenv pip install pyvips pip show tells me pyvips is Version: 2.1.1 in ABI mode

Is there anything I missed?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
matreycommented, Mar 2, 2018

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
0reactions
jcupittcommented, Mar 2, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

OSError: Cannot find pyvips library (DLLs) - Stack Overflow
Does not seem to work anymore after forced company windows10 21H2 update. get: ModuleNotFoundError: No module named 'pyvips'.
Read more >
ImportError: No module named cflib.crtp - Bitcraze Forums
Hello, I am trying to use the command: python position_commander_demo.py. When I run it, it gives me this error:
Read more >
ImportError: No module named PCANBasic,on python
Code: Select all from PCANBasic import *. in my python program, it shows an import error. Is this related to some directory issue?...
Read more >
Pip is not working: ImportError: No module named 'pip._internal'
After upgrading pip (or pip3 , in this case) if the following occurs: $ ~ pip3 -V Traceback (most recent call last): FileΒ ......
Read more >
2021 How to Fix "No Module Named..." Error in Python
2021 How to Fix ImportError " No Module Named pkg_name" in Python! First, download the package using a terminal outside of python.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found