【问题标题】:installation of cryptography fails in pip install `unicode` error在 pip install `unicode` 错误中安装加密失败
【发布时间】:2014-11-04 22:45:07
【问题描述】:

我正在尝试安装cryptography,但由于unicode 错误而失败。

[root@localhost root]$ pip install "cryptography>=0.2.1"
Downloading/unpacking cryptography>=0.2.1
  Downloading cryptography-0.5.4.tar.gz (320kB): 320kB downloaded
  Running setup.py (path:/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/build/cryptography/setup.py) egg_info for package cryptography
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    c/_cffi_backend.c:13:17: error: ffi.h: No such file or directory
    In file included from c/_cffi_backend.c:43:
    c/malloc_closure.h:33: error: expected specifier-qualifier-list before âffi_closureâ
    c/malloc_closure.h: In function âmore_coreâ:
    c/malloc_closure.h:69: warning: division by zero
    c/malloc_closure.h:96: error: âunion mmaped_blockâ has no member named ânextâ
    c/malloc_closure.h: At top level:
    c/malloc_closure.h:105: error: expected â)â before â*â token
    c/malloc_closure.h:113: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
    c/_cffi_backend.c:209: error: expected specifier-qualifier-list before âffi_cifâ
    c/_cffi_backend.c: In function âcdataowninggc_deallocâ:
    c/_cffi_backend.c:1521: error: âffi_closureâ undeclared (first use in this function)
    c/_cffi_backend.c:1521: error: (Each undeclared identifier is reported only once
    c/_cffi_backend.c:1521: error: for each function it appears in.)
    c/_cffi_backend.c:1521: error: âclosureâ undeclared (first use in this function)
    c/_cffi_backend.c:1521: error: expected expression before â)â token
    c/_cffi_backend.c:1524: warning: implicit declaration of function âcffi_closure_freeâ
    c/_cffi_backend.c: In function âcdataowninggc_traverseâ:
    c/_cffi_backend.c:1536: error: âffi_closureâ undeclared (first use in this function)
    c/_cffi_backend.c:1536: error: âclosureâ undeclared (first use in this function)
    c/_cffi_backend.c:1536: error: expected expression before â)â token
    c/_cffi_backend.c: In function âcdataowninggc_clearâ:
    c/_cffi_backend.c:1552: error: âffi_closureâ undeclared (first use in this function)
    c/_cffi_backend.c:1552: error: âclosureâ undeclared (first use in this function)
    c/_cffi_backend.c:1552: error: expected expression before â)â token
    c/_cffi_backend.c: In function âcdataowning_reprâ:
    c/_cffi_backend.c:1676: error: âffi_closureâ undeclared (first use in this function)
    c/_cffi_backend.c:1676: error: expected expression before â)â token
    c/_cffi_backend.c: At top level:
    c/_cffi_backend.c:2222: error: expected declaration specifiers or â...â before âffi_abiâ
    c/_cffi_backend.c: In function âcdata_callâ:
    c/_cffi_backend.c:2356: error: âffi_abiâ undeclared (first use in this function)
    c/_cffi_backend.c:2356: error: expected â;â before âfabiâ
    c/_cffi_backend.c:2398: error: âfabiâ undeclared (first use in this function)
    c/_cffi_backend.c:2402: error: too many arguments to function âfb_prepare_cifâ
    c/_cffi_backend.c:2407: error: âcif_description_tâ has no member named âexchange_sizeâ
    c/_cffi_backend.c:2417: error: âcif_description_tâ has no member named âexchange_offset_argâ
    c/_cffi_backend.c:2447: error: âcif_description_tâ has no member named âexchange_offset_argâ
    c/_cffi_backend.c:2452: warning: implicit declaration of function âffi_callâ
    c/_cffi_backend.c:2452: error: âcif_description_tâ has no member named âcifâ
    c/_cffi_backend.c: In function âb_new_primitive_typeâ:
    c/_cffi_backend.c:3356: error: âffi_typeâ undeclared (first use in this function)
    c/_cffi_backend.c:3356: error: âffitypeâ undeclared (first use in this function)
    c/_cffi_backend.c:3377: error: âffi_type_sint8â undeclared (first use in this function)
    c/_cffi_backend.c:3378: error: âffi_type_sint16â undeclared (first use in this function)
    c/_cffi_backend.c:3379: error: âffi_type_sint32â undeclared (first use in this function)
    c/_cffi_backend.c:3380: error: âffi_type_sint64â undeclared (first use in this function)
    c/_cffi_backend.c:3386: error: âffi_type_floatâ undeclared (first use in this function)
    c/_cffi_backend.c:3388: error: âffi_type_doubleâ undeclared (first use in this function)
    c/_cffi_backend.c:3390: error: âffi_type_longdoubleâ undeclared (first use in this function)
    c/_cffi_backend.c:3396: error: âffi_type_uint8â undeclared (first use in this function)
    c/_cffi_backend.c:3397: error: âffi_type_uint16â undeclared (first use in this function)
    c/_cffi_backend.c:3398: error: âffi_type_uint32â undeclared (first use in this function)
    c/_cffi_backend.c:3399: error: âffi_type_uint64â undeclared (first use in this function)
    c/_cffi_backend.c: At top level:
    c/_cffi_backend.c:3953: error: expected specifier-qualifier-list before âffi_typeâ
    c/_cffi_backend.c:3972: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
    c/_cffi_backend.c: In function âfb_buildâ:
    c/_cffi_backend.c:4103: error: âstruct funcbuilder_sâ has no member named âatypesâ
    c/_cffi_backend.c:4103: error: âffi_typeâ undeclared (first use in this function)
    c/_cffi_backend.c:4103: error: expected expression before â)â token
    c/_cffi_backend.c:4104: error: âstruct funcbuilder_sâ has no member named ânargsâ
    c/_cffi_backend.c:4107: error: âstruct funcbuilder_sâ has no member named ârtypeâ
    c/_cffi_backend.c:4107: warning: implicit declaration of function âfb_fill_typeâ
    c/_cffi_backend.c:4115: error: âcif_description_tâ has no member named âexchange_offset_argâ
    c/_cffi_backend.c:4118: error: âstruct funcbuilder_sâ has no member named ârtypeâ
    c/_cffi_backend.c:4119: error: âffi_argâ undeclared (first use in this function)
    c/_cffi_backend.c:4129: error: âatypeâ undeclared (first use in this function)
    c/_cffi_backend.c:4142: error: âstruct funcbuilder_sâ has no member named âatypesâ
    c/_cffi_backend.c:4143: error: âstruct funcbuilder_sâ has no member named âatypesâ
    c/_cffi_backend.c:4146: error: âcif_description_tâ has no member named âexchange_offset_argâ
    c/_cffi_backend.c:4153: error: âcif_description_tâ has no member named âexchange_sizeâ
    c/_cffi_backend.c: In function âfb_build_nameâ:
    c/_cffi_backend.c:4175: error: âstruct funcbuilder_sâ has no member named ânargsâ
    c/_cffi_backend.c:4184: error: âstruct funcbuilder_sâ has no member named âfctâ
    c/_cffi_backend.c:4186: error: âstruct funcbuilder_sâ has no member named âfctâ
    c/_cffi_backend.c: In function âfb_prepare_ctypeâ:
    c/_cffi_backend.c:4227: error: âstruct funcbuilder_sâ has no member named âfctâ
    c/_cffi_backend.c:4237: error: âstruct funcbuilder_sâ has no member named âfctâ
    c/_cffi_backend.c: At top level:
    c/_cffi_backend.c:4257: error: expected declaration specifiers or â...â before âffi_abiâ
    c/_cffi_backend.c: In function âfb_prepare_cifâ:
    c/_cffi_backend.c:4284: warning: implicit declaration of function âffi_prep_cifâ
    c/_cffi_backend.c:4284: error: âcif_description_tâ has no member named âcifâ
    c/_cffi_backend.c:4284: error: âfabiâ undeclared (first use in this function)
    c/_cffi_backend.c:4284: error: âstruct funcbuilder_sâ has no member named ânargsâ
    c/_cffi_backend.c:4285: error: âstruct funcbuilder_sâ has no member named ârtypeâ
    c/_cffi_backend.c:4285: error: âstruct funcbuilder_sâ has no member named âatypesâ
    c/_cffi_backend.c:4285: error: âFFI_OKâ undeclared (first use in this function)
    c/_cffi_backend.c: In function âb_new_function_typeâ:
    c/_cffi_backend.c:4302: error: âFFI_DEFAULT_ABIâ undeclared (first use in this function)
    c/_cffi_backend.c:4340: error: too many arguments to function âfb_prepare_cifâ
    c/_cffi_backend.c:4348: error: âstruct funcbuilder_sâ has no member named ânargsâ
    c/_cffi_backend.c:4358: error: âstruct funcbuilder_sâ has no member named ânargsâ
    c/_cffi_backend.c: In function âconvert_from_object_fficallbackâ:
    c/_cffi_backend.c:4382: error: âffi_argâ undeclared (first use in this function)
    c/_cffi_backend.c: At top level:
    c/_cffi_backend.c:4454: error: expected â)â before â*â token
    c/_cffi_backend.c: In function âb_callbackâ:
    c/_cffi_backend.c:4525: error: âffi_closureâ undeclared (first use in this function)
    c/_cffi_backend.c:4525: error: âclosureâ undeclared (first use in this function)
    c/_cffi_backend.c:4546: error: âffi_argâ undeclared (first use in this function)
    c/_cffi_backend.c:4564: warning: implicit declaration of function âcffi_closure_allocâ
    c/_cffi_backend.c:4581: warning: implicit declaration of function âffi_prep_closureâ
    c/_cffi_backend.c:4581: error: âcif_description_tâ has no member named âcifâ
    c/_cffi_backend.c:4582: error: âinvoke_callbackâ undeclared (first use in this function)
    c/_cffi_backend.c:4582: error: âFFI_OKâ undeclared (first use in this function)
    c/_cffi_backend.c: In function âinit_cffi_backendâ:
    c/_cffi_backend.c:5511: error: âFFI_DEFAULT_ABIâ undeclared (first use in this function)
    compiling '_configtest.c':
    __thread int some_threadlocal_variable_42;
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/build/cryptography/setup.py", line 174, in <module>
        "test": PyTest,
      File "/usr/lib64/python2.6/distutils/core.py", line 113, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/dist.py", line 262, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/dist.py", line 287, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pkg_resources.py", line 631, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pkg_resources.py", line 874, in best_match
        return self.obtain(req, installer)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pkg_resources.py", line 886, in obtain
        return installer(requirement)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/dist.py", line 338, in fetch_build_egg
        return cmd.easy_install(req)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 613, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 643, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 833, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1055, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1043, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
    Complete output from command python setup.py egg_info:
    Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

c/_cffi_backend.c:13:17: error: ffi.h: No such file or directory

In file included from c/_cffi_backend.c:43:

c/malloc_closure.h:33: error: expected specifier-qualifier-list before âffi_closureâ

c/malloc_closure.h: In function âmore_coreâ:

c/malloc_closure.h:69: warning: division by zero

c/malloc_closure.h:96: error: âunion mmaped_blockâ has no member named ânextâ

c/malloc_closure.h: At top level:

c/malloc_closure.h:105: error: expected â)â before â*â token

c/malloc_closure.h:113: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token

c/_cffi_backend.c:209: error: expected specifier-qualifier-list before âffi_cifâ

c/_cffi_backend.c: In function âcdataowninggc_deallocâ:

c/_cffi_backend.c:1521: error: âffi_closureâ undeclared (first use in this function)

c/_cffi_backend.c:1521: error: (Each undeclared identifier is reported only once

c/_cffi_backend.c:1521: error: for each function it appears in.)

c/_cffi_backend.c:1521: error: âclosureâ undeclared (first use in this function)

c/_cffi_backend.c:1521: error: expected expression before â)â token

c/_cffi_backend.c:1524: warning: implicit declaration of function âcffi_closure_freeâ

c/_cffi_backend.c: In function âcdataowninggc_traverseâ:

c/_cffi_backend.c:1536: error: âffi_closureâ undeclared (first use in this function)

c/_cffi_backend.c:1536: error: âclosureâ undeclared (first use in this function)

c/_cffi_backend.c:1536: error: expected expression before â)â token

c/_cffi_backend.c: In function âcdataowninggc_clearâ:

c/_cffi_backend.c:1552: error: âffi_closureâ undeclared (first use in this function)

c/_cffi_backend.c:1552: error: âclosureâ undeclared (first use in this function)

c/_cffi_backend.c:1552: error: expected expression before â)â token

c/_cffi_backend.c: In function âcdataowning_reprâ:

c/_cffi_backend.c:1676: error: âffi_closureâ undeclared (first use in this function)

c/_cffi_backend.c:1676: error: expected expression before â)â token

c/_cffi_backend.c: At top level:

c/_cffi_backend.c:2222: error: expected declaration specifiers or â...â before âffi_abiâ

c/_cffi_backend.c: In function âcdata_callâ:

c/_cffi_backend.c:2356: error: âffi_abiâ undeclared (first use in this function)

c/_cffi_backend.c:2356: error: expected â;â before âfabiâ

c/_cffi_backend.c:2398: error: âfabiâ undeclared (first use in this function)

c/_cffi_backend.c:2402: error: too many arguments to function âfb_prepare_cifâ

c/_cffi_backend.c:2407: error: âcif_description_tâ has no member named âexchange_sizeâ

c/_cffi_backend.c:2417: error: âcif_description_tâ has no member named âexchange_offset_argâ

c/_cffi_backend.c:2447: error: âcif_description_tâ has no member named âexchange_offset_argâ

c/_cffi_backend.c:2452: warning: implicit declaration of function âffi_callâ

c/_cffi_backend.c:2452: error: âcif_description_tâ has no member named âcifâ

c/_cffi_backend.c: In function âb_new_primitive_typeâ:

c/_cffi_backend.c:3356: error: âffi_typeâ undeclared (first use in this function)

c/_cffi_backend.c:3356: error: âffitypeâ undeclared (first use in this function)

c/_cffi_backend.c:3377: error: âffi_type_sint8â undeclared (first use in this function)

c/_cffi_backend.c:3378: error: âffi_type_sint16â undeclared (first use in this function)

c/_cffi_backend.c:3379: error: âffi_type_sint32â undeclared (first use in this function)

c/_cffi_backend.c:3380: error: âffi_type_sint64â undeclared (first use in this function)

c/_cffi_backend.c:3386: error: âffi_type_floatâ undeclared (first use in this function)

c/_cffi_backend.c:3388: error: âffi_type_doubleâ undeclared (first use in this function)

c/_cffi_backend.c:3390: error: âffi_type_longdoubleâ undeclared (first use in this function)

c/_cffi_backend.c:3396: error: âffi_type_uint8â undeclared (first use in this function)

c/_cffi_backend.c:3397: error: âffi_type_uint16â undeclared (first use in this function)

c/_cffi_backend.c:3398: error: âffi_type_uint32â undeclared (first use in this function)

c/_cffi_backend.c:3399: error: âffi_type_uint64â undeclared (first use in this function)

c/_cffi_backend.c: At top level:

c/_cffi_backend.c:3953: error: expected specifier-qualifier-list before âffi_typeâ

c/_cffi_backend.c:3972: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token

c/_cffi_backend.c: In function âfb_buildâ:

c/_cffi_backend.c:4103: error: âstruct funcbuilder_sâ has no member named âatypesâ

c/_cffi_backend.c:4103: error: âffi_typeâ undeclared (first use in this function)

c/_cffi_backend.c:4103: error: expected expression before â)â token

c/_cffi_backend.c:4104: error: âstruct funcbuilder_sâ has no member named ânargsâ

c/_cffi_backend.c:4107: error: âstruct funcbuilder_sâ has no member named ârtypeâ

c/_cffi_backend.c:4107: warning: implicit declaration of function âfb_fill_typeâ

c/_cffi_backend.c:4115: error: âcif_description_tâ has no member named âexchange_offset_argâ

c/_cffi_backend.c:4118: error: âstruct funcbuilder_sâ has no member named ârtypeâ

c/_cffi_backend.c:4119: error: âffi_argâ undeclared (first use in this function)

c/_cffi_backend.c:4129: error: âatypeâ undeclared (first use in this function)

c/_cffi_backend.c:4142: error: âstruct funcbuilder_sâ has no member named âatypesâ

c/_cffi_backend.c:4143: error: âstruct funcbuilder_sâ has no member named âatypesâ

c/_cffi_backend.c:4146: error: âcif_description_tâ has no member named âexchange_offset_argâ

c/_cffi_backend.c:4153: error: âcif_description_tâ has no member named âexchange_sizeâ

c/_cffi_backend.c: In function âfb_build_nameâ:

c/_cffi_backend.c:4175: error: âstruct funcbuilder_sâ has no member named ânargsâ

c/_cffi_backend.c:4184: error: âstruct funcbuilder_sâ has no member named âfctâ

c/_cffi_backend.c:4186: error: âstruct funcbuilder_sâ has no member named âfctâ

c/_cffi_backend.c: In function âfb_prepare_ctypeâ:

c/_cffi_backend.c:4227: error: âstruct funcbuilder_sâ has no member named âfctâ

c/_cffi_backend.c:4237: error: âstruct funcbuilder_sâ has no member named âfctâ

c/_cffi_backend.c: At top level:

c/_cffi_backend.c:4257: error: expected declaration specifiers or â...â before âffi_abiâ

c/_cffi_backend.c: In function âfb_prepare_cifâ:

c/_cffi_backend.c:4284: warning: implicit declaration of function âffi_prep_cifâ

c/_cffi_backend.c:4284: error: âcif_description_tâ has no member named âcifâ

c/_cffi_backend.c:4284: error: âfabiâ undeclared (first use in this function)

c/_cffi_backend.c:4284: error: âstruct funcbuilder_sâ has no member named ânargsâ

c/_cffi_backend.c:4285: error: âstruct funcbuilder_sâ has no member named ârtypeâ

c/_cffi_backend.c:4285: error: âstruct funcbuilder_sâ has no member named âatypesâ

c/_cffi_backend.c:4285: error: âFFI_OKâ undeclared (first use in this function)

c/_cffi_backend.c: In function âb_new_function_typeâ:

c/_cffi_backend.c:4302: error: âFFI_DEFAULT_ABIâ undeclared (first use in this function)

c/_cffi_backend.c:4340: error: too many arguments to function âfb_prepare_cifâ

c/_cffi_backend.c:4348: error: âstruct funcbuilder_sâ has no member named ânargsâ

c/_cffi_backend.c:4358: error: âstruct funcbuilder_sâ has no member named ânargsâ

c/_cffi_backend.c: In function âconvert_from_object_fficallbackâ:

c/_cffi_backend.c:4382: error: âffi_argâ undeclared (first use in this function)

c/_cffi_backend.c: At top level:

c/_cffi_backend.c:4454: error: expected â)â before â*â token

c/_cffi_backend.c: In function âb_callbackâ:

c/_cffi_backend.c:4525: error: âffi_closureâ undeclared (first use in this function)

c/_cffi_backend.c:4525: error: âclosureâ undeclared (first use in this function)

c/_cffi_backend.c:4546: error: âffi_argâ undeclared (first use in this function)

c/_cffi_backend.c:4564: warning: implicit declaration of function âcffi_closure_allocâ

c/_cffi_backend.c:4581: warning: implicit declaration of function âffi_prep_closureâ

c/_cffi_backend.c:4581: error: âcif_description_tâ has no member named âcifâ

c/_cffi_backend.c:4582: error: âinvoke_callbackâ undeclared (first use in this function)

c/_cffi_backend.c:4582: error: âFFI_OKâ undeclared (first use in this function)

c/_cffi_backend.c: In function âinit_cffi_backendâ:

c/_cffi_backend.c:5511: error: âFFI_DEFAULT_ABIâ undeclared (first use in this function)

compiling '_configtest.c':

__thread int some_threadlocal_variable_42;

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/build/cryptography/setup.py", line 174, in <module>

    "test": PyTest,

  File "/usr/lib64/python2.6/distutils/core.py", line 113, in setup

    _setup_distribution = dist = klass(attrs)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/dist.py", line 262, in __init__

    self.fetch_build_eggs(attrs['setup_requires'])

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/dist.py", line 287, in fetch_build_eggs

    replace_conflicting=True,

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pkg_resources.py", line 631, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pkg_resources.py", line 874, in best_match

    return self.obtain(req, installer)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pkg_resources.py", line 886, in obtain

    return installer(requirement)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/dist.py", line 338, in fetch_build_egg

    return cmd.easy_install(req)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 613, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 643, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 833, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1055, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1043, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/build/cryptography
Traceback (most recent call last):
  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/bin/pip", line 8, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/home/nileshkumar-govindbhai.patel/workspaces/gozer/horizon/.venv/lib/python2.6/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 75: ordinal not in range(128)

它给出了 unicode 错误:(

【问题讨论】:

    标签: python linux installation pip


    【解决方案1】:

    您的实际问题似乎是您没有安装libffi。您可以在设置步骤中看到数百条关于无法找到 libffi 的消息,以及尝试包含 ffi.h 的 C 编译器错误,等等。所以,你需要做的就是安装它。

    这是一个 C 库,而不是 Python 库。您的平台可能有一个软件包,您可以使用 yumaptbrewport 或其他方式安装它;如果没有,您可以下载并手动安装。 (IIRC,您可以只使用./configure &amp;&amp; make install,但请阅读文档。)在某些平台上,您可能还需要libffi-devellibffi-devlibffi-libs 或类似的包。

    此外,您没有 libffi 的事实也意味着您可能没有 CPython 开发文件(因为在大多数平台上,它们依赖于 libffi),这意味着您只会遇到另一个一旦你通过了这个问题。这些可能与python 位于一个单独的包中,名为python-devel 等(或者可能是python27-devel 或类似名称)。


    那么,最后的UnicodeError 是什么?好吧,你的设置肯定有问题。在您的所有输出中,您会得到类似âmore_coreâ 的内容,显然每个' 都打印为â。这闻起来像 Latin-1 与 UTF-8 mojibake,但很难确定。

    无论如何,在某些时候,Python 会尝试生成一些包含 â 字符的输出(很可能是实际异常的异常消息)(请注意,它抱怨的是 0xe2,而 '\xe2'.decode('latin-1')u'â')。但它未能检测到您的终端,因此它尝试将字符串编码为 ASCII,当然这失败了,因此它引发了 UnicodeError,它隐藏了真正的错误。 (这是在 2.x 设计中几乎不可能在没有大量骇客的情况下修复的问题之一,但它在 3.x 分支的早期就已修复,并且从那时起得到了进一步的改进。不幸的是,你'仍在使用 2.7,所以这对你没有帮助。)

    【讨论】:

    • 我尝试安装 libffi 并显示“软件包 libffi-3.0.5-3.2.el6.x86_64 已安装且最新版本”
    • @Lafada: 好的,libffi-devel 或者任何你的发行版称之为此类包的东西,正如我在下一段中所说的那样?这就是你将如何获得pkgconfig 记录、.so 符号链接、头文件以及构建依赖于libffi 的任何东西所需的所有其他东西。
    • sudo apt-get install libffi-dev 为我做了。干杯阿巴纳特
    • 'sudo yum install libffi-devel' 在 CentOS 上为我做的
    猜你喜欢
    • 2020-03-27
    • 2019-10-31
    • 1970-01-01
    • 2018-12-26
    • 2018-03-12
    • 2021-05-23
    • 2012-07-17
    • 1970-01-01
    相关资源
    最近更新 更多