在pip安装时出现`unicode`错误导致加密库安装失败
我正在尝试安装 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 错误 :(
1 个回答
看起来你遇到的主要问题是没有安装 libffi
。在安装过程中,你会看到很多关于找不到 libffi
的错误信息,还有在尝试包含 ffi.h
时出现的 C 编译器错误等等。所以,你需要做的就是安装它。
这个是一个 C 语言的库,不是 Python 的库。你的系统可能有可以用 yum
、apt
、brew
或 port
等工具安装的包;如果没有,你可以手动下载并安装它。(如果我没记错的话,你可以直接用 ./configure && make install
,但最好还是看看文档。)在某些平台上,你可能还需要安装 libffi-devel
、libffi-dev
或 libffi-libs
之类的包。
另外,你没有 libffi
也意味着你可能没有 CPython 的开发文件(因为在大多数平台上,它们依赖于 libffi
),这意味着一旦你解决了这个问题,你可能会遇到另一个问题。这些开发文件可能在一个与 python
不同的包里,叫做 python-devel
等等(或者可能是 python27-devel
或类似的名字)。
那么,最后的 UnicodeError
是怎么回事呢?嗯,你的设置肯定有些问题。在你的输出中,你会看到像 âmore_coreâ
这样的东西,显然每个 '
都变成了 â
。这听起来像是拉丁-1 和 UTF-8 之间的编码问题,但不太好确认。
无论如何,在某个时刻,Python 正在尝试生成一些输出(很可能是实际异常的异常消息),其中包含一个 â
字符(注意它在抱怨 0xe2
,而 '\xe2'.decode('latin-1')
是 u'â'
)。但它没有正确识别你的终端,所以它试图将字符串编码为 ASCII,当然这会失败,因此抛出了一个 UnicodeError
,这掩盖了真正的错误。(这是在 2.x 版本中几乎不可能修复的问题,除非进行大量的黑客操作,但在 3.x 版本中很早就修复了,并且此后进一步改进。不幸的是,你仍在使用 2.7,所以这对你没有帮助。)