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.

Python3 Ctypes Backend Version Mismatch on Ubuntu 16.04

See original GitHub issue

I want pysoundfile to work correctly on Python3 so badly, but for the life of me I can’t figure out a workaround for this.

In [1]: import soundfile
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-1-aaba2ade8dee> in <module>()
----> 1 import soundfile

/usr/local/lib/python3.5/dist-packages/soundfile.py in <module>()
     21     _unicode = str
     22 
---> 23 _ffi = _FFI()
     24 _ffi.cdef("""
     25 enum

/usr/local/lib/python3.5/dist-packages/cffi/api.py in __init__(self, backend)
     57             from . import __version__
     58             assert backend.__version__ == __version__, \
---> 59                "version mismatch, %s != %s" % (backend.__version__, __version__)
     60             # (If you insist you can also try to pass the option
     61             # 'backend=backend_ctypes.CTypesBackend()', but don't

AssertionError: version mismatch, 1.5.2 != 1.9.1

My cffi.__version__ is '1.9.1', and I have no idea how to change the backend. This may not strictly be a pysoundfile issue, but this is the only place where I encounter this problem and I’ve given up trying to fix it so many times…

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Teque5commented, Jun 12, 2017

@mgeier this fixed it.

I guess at some point I used pip to upgrade cffi. Removing it via pip and installing it via apt-get install python3-cffi seemed to fix the problem on Ubuntu 16.04.

Thanks. Maybe this will help someone else.

1reaction
mgeiercommented, Jun 10, 2017

@Teque5 You should probably not remove python3-cffi-backend if other needed packages depend on it.

You should try to remove the version of the cffi module which you previously installed with pip, and just use the one coming with Ubuntu.

Run this multiple times, until it says there is no package with that name (or that it won’t uninstall the one in /usr/lib/python3/dist-packages/):

python3 -m pip uninstall cffi

If it still doesn’t work, have a look if the directory /usr/local/lib/python3.5/dist-packages/cffi/ still exists and manually delete it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python3 Ctypes Backend Version Mismatch on Ubuntu 16.04
I want pysoundfile to work correctly on Python3 so badly, but for the life of me I can't figure out a workaround for...
Read more >
Exception: Version mismatch:cffi - python - Stack Overflow
The problem is that there are two different versions of 'cffi'.You can make sure the version is consistent by updating the old version....
Read more >
Changelog — Python 3.11.1 documentation
Patch by Honglin Zhu. gh-90081: Run Python code in tracer/profiler function at full speed. Fixes slowdown in earlier versions of 3.11.
Read more >
python3-usb_1.0.0-1_all.deb Ubuntu 18.04 LTS Download
This version of python-usb is written entirely in Python and uses ctypes to interact with various USB libraries This package contains the Python...
Read more >
Bug listing with status RESOLVED with resolution TEST ...
... Bug:14720 - "libsafe-2.0.16.ebuild (New Package)" status:RESOLVED ... "imlib2 emerge fails with libtool.m4 and ltmain.sh have a version mismatch!
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