Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when install pylibmc using pip

Hello when I attempt to install pylibmc on OSX Lion using pip I get the following error:

./_pylibmcmodule.h:42:10: fatal error: 'libmemcached/memcached.h' file not found  #include <libmemcached/memcached.h>           ^  1 error generated.  error: command 'clang' failed with exit status 1 

Any clues at how to solve this issue?

like image 419
harristrader Avatar asked Feb 10 '13 22:02

harristrader


People also ask

Why can't I install using PIP?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

How do I fix legacy install failure?

To solve the "Error: legacy-install-failure":Upgrade your versions of pip , setuptools and wheel before running pip install . Check if your Python version is supported by the package. On Windows, download and install the package from unofficial binaries. Try to install the package with the --pre option.


2 Answers

libmemcached may also be installed using Homebrew.

brew install libmemcached 

After that, pip install pylibmc worked for me without needing to specify any additional arguments.

like image 80
Jeremy Avatar answered Nov 11 '22 21:11

Jeremy


It's in the libmemcached package. To install it using macports:

sudo port install libmemcached

Then, assuming you're using pip:

pip install pylibmc --install-option="--with-libmemcached=/opt/local"

or

LIBMEMCACHED=/opt/local pip install pylibmc

as explained in the pylibmc docs.

like image 27
Mike Fogel Avatar answered Nov 11 '22 22:11

Mike Fogel