MacOS : Cannot allocate write+execute memory for ffi.callback()

See original GitHub issue

python3 play_file.py file.wav

MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HaHehocommented, Jun 2, 2022

In general, I would recommend conda-forge over the default channel. However, I wasn’t aware of this:

For things like numpy this is not preferable however (strong performance differences depending on system architecture).

This seems unfortunate. Why is conda-forge not as good? Isn’t that something that should be fixed? I didn’t find an issue for that: https://github.com/conda-forge/numpy-feedstock/issues

https://anaconda.org/anaconda/numpy https://anaconda.org/conda-forge/numpy

FYI, the difference is what accelerated linear algebra library Numpy is built against, as documented here https://numpy.org/install/#numpy-packages--accelerated-linear-algebra-libraries. I suppose the conclusion of “strong performance differences” should be taken with a grain of salt and seen in context of what one is intending to do, and on what system architecture.

0reactions
petriewongcommented, Nov 7, 2022

Hi, I had the same issue with my M1 mac mini, macos 13.0 & anaconda environment.

pip uninstall cffi
pip install cffi 

It works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

apple m1 cannot allocate write+execute memory for ffi ...
using m1 mac; pip install mitmproxy,; print mitmproxy. and appear error cannot allocate write+execute memory for ffi.callback().
Read more >
Scrapy on M1 Mac: MemoryError - Stack Overflow
I've got this working on an M1 with python 3.9.6 but I'm getting the ffi.callback() error on an M1 with 3.10.4. Both are...
Read more >
I am receiving a MemoryError: Cannot allocate write+execute ...
I am receiving a MemoryError: Cannot allocate write+execute memory for ffi.callback(). when trying to set up snowpark on a mac M1 in jupyter ......
Read more >
Running Snowpark Python on Apple M1 chips workaround
The error message displayed is, “Cannot allocate write+execute memory for ffi.callback()”. As a workaround, set up a virtual environment ...
Read more >
Unable to run audio libraries in… | Apple Developer Forums
... in <module> _lib = _ffi.dlopen(_libname) OSError: cannot load library ... _): MemoryError: Cannot allocate write+execute memory for ffi.callback().
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