Hiredis: لا يمكن التثبيت على ubuntu 14.10

تم إنشاؤها على ٩ يونيو ٢٠١٥  ·  5تعليقات  ·  مصدر: redis/hiredis

خطأ عند تثبيت Will على ubuntu 14.10:

In file included from src/hiredis.c:1:0:
    src/hiredis.h:4:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

إصدار أوبونتو:

$ uname -a
Linux ip-10-0-102-121 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

فيما يلي الخطوات التي تم اتخاذها:

(آلة نظيفة ، مثيل AWS جديد)

$ sudo pip install hiredis
sudo: unable to resolve host ip-10-0-102-121
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting hiredis
/usr/local/lib/python2.7/dist-packages/pip-7.0.3-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading hiredis-0.2.0.tar.gz (46kB)
    100% |################################| 49kB 2.7MB/s
Building wheels for collected packages: hiredis
  Running setup.py bdist_wheel for hiredis
  Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-OJDxMJ/hiredis/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpjtOVKVpip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/hiredis
  copying hiredis/version.py -> build/lib.linux-x86_64-2.7/hiredis
  copying hiredis/__init__.py -> build/lib.linux-x86_64-2.7/hiredis
  running build_clib
  building 'hiredis_for_hiredis_py' library
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/vendor
  creating build/temp.linux-x86_64-2.7/vendor/hiredis
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/read.o
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o
  ar rc build/temp.linux-x86_64-2.7/libhiredis_for_hiredis_py.a build/temp.linux-x86_64-2.7/vendor/hiredis/read.o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o
  running build_ext
  building 'hiredis.hiredis' extension
  creating build/temp.linux-x86_64-2.7/src
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor -I/usr/include/python2.7 -c src/hiredis.c -o build/temp.linux-x86_64-2.7/src/hiredis.o
  In file included from src/hiredis.c:1:0:
  src/hiredis.h:4:20: fatal error: Python.h: No such file or directory
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for hiredis
Failed to build hiredis
Installing collected packages: hiredis
  Running setup.py install for hiredis
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-OJDxMJ/hiredis/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7z3BpS-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    running build_clib
    building 'hiredis_for_hiredis_py' library
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/read.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o
    running build_ext
    building 'hiredis.hiredis' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor -I/usr/include/python2.7 -c src/hiredis.c -o build/temp.linux-x86_64-2.7/src/hiredis.o
    In file included from src/hiredis.c:1:0:
    src/hiredis.h:4:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-OJDxMJ/hiredis/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7z3BpS-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-OJDxMJ/hiredis

التعليق الأكثر فائدة

لدي أيضًا مشكلة في Ubuntu 14 مع Python3 ، وقمت بحلها بـ sudo apt-get install python3-dev . إنها المرة الأولى التي أعرف فيها أن python-dev لا يغطي Python3 ... orz

ال 5 كومينتر

تم إنشاؤه من https://github.com/skoczen/will/issues/160

الحل:

apt-get install python-dev

هذا ليس حلاً ، هذا هو الإصلاح. إذا كنت ترغب في تثبيت وحدات Python النمطية المكتوبة بلغة C ، فأنت بحاجة إلى حزمة dev للحصول على الرؤوس.

ولكن عند التثبيت عبر النقطة:

sudo pip install hiredis

ألا يجب تثبيت التبعية أيضًا؟
أو على الأقل أشر في رسالة إلى أنه يجب تثبيت pyhon-dev.

ليس لدى pip أي فكرة عن نظامك ولا تعرف كيفية التثبيت باستخدام apt. حتى أن هناك أنظمة لا تنقسم إلى حزم مطوّرة وغير مطوّرة ، لذلك لا داعي لذلك.

لدي أيضًا مشكلة في Ubuntu 14 مع Python3 ، وقمت بحلها بـ sudo apt-get install python3-dev . إنها المرة الأولى التي أعرف فيها أن python-dev لا يغطي Python3 ... orz

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات

القضايا ذات الصلة

DoctorUSB picture DoctorUSB  ·  8تعليقات

noloader picture noloader  ·  10تعليقات

gameyin picture gameyin  ·  6تعليقات

yudataguy picture yudataguy  ·  10تعليقات

lmcd picture lmcd  ·  17تعليقات