[Solved]-Fatal error: libmemcached/memcached.h: no such file or directory

20👍

You need to install the development header files via your OS package manager:

For example on Ubuntu:

sudo apt install libmemcached-dev

0👍

For m1 mac:

Try install/reinstall

brew install libmemcached

and then

pip install pylibmc

If you still face the issue then try:

pip install pylibmc --install-option="--with-libmemcached=/usr/local/Cellar/libmemcached/1.0.18/"

Please note: Change libmemcached path according to your machine and package version for eg in my case path is /opt/homebrew/Cellar/libmemcached/1.0.18_2/

0👍

Install libmemcached:

brew install libmemcached

now find the path in which libmemcached installed, it’ll be something like:
/opt/homebrew/Cellar/libmemcached/1.0.18_2

Now run the following command, replacing with your path:

LIBMEMCACHED=/usr/local/Cellar/libmemcached/1.0.18_2 pip install pylibmc

Leave a comment