‘pip2 install cryptography’ does not work

dieter dieter at handshake.de
Thu Sep 15 04:19:20 EDT 2016


Cecil Westerhof <Cecil at decebal.nl> writes:

> I try to do a:
>     pip2 install cryptography
>
> But this give:
>     gcc -pthread -shared build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o -L/usr/lib64 -lssl -lcrypto -lpython2.7 -o build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/_openssl.so
>     /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
>     /usr/lib64/libpython2.7.a: error adding symbols: Bad value
>     collect2: error: ld returned 1 exit status
>     error: command 'gcc' failed with exit status 1

Apparently, the linker requires use of the "-fPIC" option
("PIC" stands for "position independent code") for linking a shared
library.

The problem might come from your system's Python installation
(apparently, that one is used). Usually, you would have
a "libpython*.so" (i.e. a shared object) and it would contain
modules compiled with "-fPIC". In your case, the
static library "libpython*.a" seems to be used and (apparently)
contains not position idependent modules.




More information about the Python-list mailing list