Error when install pylibmc using pip

前端 未结 10 1304
灰色年华
灰色年华 2021-01-31 01:22

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         


        
相关标签:
10条回答
  • 2021-01-31 01:54

    Hit the same error with macOS High Sierra, Python3.6 installed with brew. Solution for me was to export these flags, mentioned in this comment: Error when install pylibmc using pip

    export LDFLAGS="-L/usr/local/lib"
    export CPPFLAGS="-I/usr/local/include"
    

    After that, pip install run just fine.

    0 讨论(0)
  • 2021-01-31 01:54

    Sometimes the X-Code Command Line Tools need to be installed.

     xcode-select -p
    
    0 讨论(0)
  • 2021-01-31 02:01

    For those finding this answer on Fedora:

    sudo yum install libmemcached-devel

    0 讨论(0)
  • 2021-01-31 02:02

    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.

    0 讨论(0)
提交回复
热议问题