在 Amazon Linux (EC2) 上安装 pyOpenSSL

发布于 10-16 04:25 字数 21096 浏览 11 评论 0原文

我在 ec2 上使用 amazon Linux 的第一个默认 AMI,但似乎无法安装 pyOpenSSL。 我试过: sudo wget http://launchpad.net/pyopenssl/main/ 0.11/+download/pyOpenSSL-0.11.tar.gz && easy_install pyOpenSSL-0.11.tar.gz。

Results were:
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/test-easy-install-21047.write-test'

还尝试过: 结果是: sudo python setup.py build

/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'zip_safe'
  warnings.warn(msg)
running build
running build_py
running build_ext
building 'OpenSSL.crypto' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.6 -c OpenSSL/crypto/crypto.c -o build/temp.linux-i686-2.6/OpenSSL/crypto/crypto.o
OpenSSL/crypto/crypto.c:13:20: error: Python.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:17,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509.h:17:25: error: openssl/ssl.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:17,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509_Type’
OpenSSL/crypto/x509.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/x509.h:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/x509.h:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/x509.h:31: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:18,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509name.h:19: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509name.h:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Name_Type’
OpenSSL/crypto/x509name.h:26: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:19,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/netscape_spki.h:16: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/netscape_spki.h:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_NetscapeSPKI_Type’
OpenSSL/crypto/netscape_spki.h:23: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:20,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509store.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509store.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Store_Type’
OpenSSL/crypto/x509store.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:21,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509req.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509req.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Req_Type’
OpenSSL/crypto/x509req.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:22,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkey.h:15: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/pkey.h:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_PKey_Type’
OpenSSL/crypto/pkey.h:22: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:23,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509ext.h:16:28: error: openssl/x509v3.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:23,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509ext.h:18: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509ext.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Extension_Type’
OpenSSL/crypto/x509ext.h:27: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:24,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs7.h:15:27: error: openssl/pkcs7.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:24,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs7.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/pkcs7.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_PKCS7_Type’
OpenSSL/crypto/pkcs7.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:25,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs12.h:14:28: error: openssl/pkcs12.h: No such file or directory
OpenSSL/crypto/pkcs12.h:15:26: error: openssl/asn1.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:25,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs12.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/pkcs12.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_PKCS12_Type’
OpenSSL/crypto/pkcs12.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/pkcs12.h:37: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:26,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/crl.h:6: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crl.h:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_CRL_Type’
OpenSSL/crypto/crl.h:13: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/crl.h:17: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:27,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/revoked.h:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_Revoked_Type’
OpenSSL/crypto/revoked.h:11: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/revoked.h:15: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/revoked.h:16: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:28,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/../util.h:17:25: error: openssl/err.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:28,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/../util.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/../util.h:32: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:63: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:78: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:83: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:135: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/crypto.h:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.h:74: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:75: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:76: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:77: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:78: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:80: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:81: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:83: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.c:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:27: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.c: In function ‘global_passphrase_callback’:
OpenSSL/crypto/crypto.c:42: error: ‘PyObject’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: error: (Each undeclared identifier is reported only once
OpenSSL/crypto/crypto.c:42: error: for each function it appears in.)
OpenSSL/crypto/crypto.c:42: error: ‘func’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: error: ‘argv’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: warning: left-hand operand of comma expression has no effect
OpenSSL/crypto/crypto.c:42: error: ‘ret’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: warning: left-hand operand of comma expression has no effect
OpenSSL/crypto/crypto.c:45: error: expected expression before ‘)’ token
OpenSSL/crypto/crypto.c:46: warning: implicit declaration of function ‘Py_BuildValue’
OpenSSL/crypto/crypto.c:47: warning: implicit declaration of function ‘PyEval_CallObject’
OpenSSL/crypto/crypto.c:48: warning: implicit declaration of function ‘Py_DECREF’
OpenSSL/crypto/crypto.c:49: error: ‘NULL’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:51: warning: implicit declaration of function ‘PyString_Check’
OpenSSL/crypto/crypto.c:53: warning: implicit declaration of function ‘PyErr_SetString’
OpenSSL/crypto/crypto.c:53: error: ‘PyExc_ValueError’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:56: warning: implicit declaration of function ‘PyString_Size’
OpenSSL/crypto/crypto.c:59: warning: implicit declaration of function ‘strncpy’
OpenSSL/crypto/crypto.c:59: warning: incompatible implicit declaration of built-in function ‘strncpy’
OpenSSL/crypto/crypto.c:59: warning: implicit declaration of function ‘PyString_AsString’
OpenSSL/crypto/crypto.c:59: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
OpenSSL/crypto/crypto.c: At top level:
OpenSSL/crypto/crypto.c:75: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:150: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:249: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:296: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:352: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:399: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:456: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:500: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:552: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:583: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:600: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:615: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:662: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:707: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_methods’
OpenSSL/crypto/crypto.c: In function ‘initcrypto’:
OpenSSL/crypto/crypto.c:810: error: ‘PyObject’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:810: error: ‘c_api_object’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:812: error: ‘module’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:814: warning: implicit declaration of function ‘ERR_load_crypto_strings’
OpenSSL/crypto/crypto.c:815: warning: implicit declaration of function ‘OpenSSL_add_all_algorithms’
OpenSSL/crypto/crypto.c:820: warning: implicit declaration of function ‘Py_InitModule3’
OpenSSL/crypto/crypto.c:820: error: ‘crypto_methods’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:823: error: ‘NULL’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:829: error: ‘crypto_X509_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:830: error: ‘crypto_X509Name_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:831: error: ‘crypto_X509Req_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:832: error: ‘crypto_X509Store_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:833: error: ‘crypto_PKey_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:835: error: ‘crypto_PKCS7_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:836: error: ‘crypto_NetscapeSPKI_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:837: warning: implicit declaration of function ‘PyCObject_FromVoidPtr’
OpenSSL/crypto/crypto.c:839: warning: implicit declaration of function ‘PyModule_AddObject’
OpenSSL/crypto/crypto.c:842: error: ‘crypto_Error’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:842: warning: implicit declaration of function ‘PyErr_NewException’
OpenSSL/crypto/crypto.c:848: warning: implicit declaration of function ‘PyModule_AddIntConstant’
OpenSSL/crypto/crypto.c:848: error: ‘X509_FILETYPE_PEM’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:849: error: ‘X509_FILETYPE_ASN1’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:852: error: ‘EVP_PKEY_RSA’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:853: error: ‘EVP_PKEY_DSA’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:859: warning: implicit declaration of function ‘init_crypto_x509’
OpenSSL/crypto/crypto.c:861: warning: implicit declaration of function ‘init_crypto_x509name’
OpenSSL/crypto/crypto.c:863: warning: implicit declaration of function ‘init_crypto_x509store’
OpenSSL/crypto/crypto.c:865: warning: implicit declaration of function ‘init_crypto_x509req’
OpenSSL/crypto/crypto.c:867: warning: implicit declaration of function ‘init_crypto_pkey’
OpenSSL/crypto/crypto.c:869: warning: implicit declaration of function ‘init_crypto_x509extension’
OpenSSL/crypto/crypto.c:871: warning: implicit declaration of function ‘init_crypto_pkcs7’
OpenSSL/crypto/crypto.c:873: warning: implicit declaration of function ‘init_crypto_pkcs12’
OpenSSL/crypto/crypto.c:875: warning: implicit declaration of function ‘init_crypto_netscape_spki’
OpenSSL/crypto/crypto.c:877: warning: implicit declaration of function ‘init_crypto_crl’
OpenSSL/crypto/crypto.c:879: warning: implicit declaration of function ‘init_crypto_revoked’
error: command 'gcc' failed with exit status 1

我认为我需要确保安装了 python devel 以获得标头,检查了 yum 已安装的内容。 百胜清单| grep python 产生:

audit-libs-python.i386                    1.7.17-3.10.amzn1            installed
dbus-python.i386                          0.83.0-6.1.5.amzn1           installed
gamin-python.i386                         0.1.10-9.6.amzn1             installed
libselinux-python.i386                    2.0.94-1.6.amzn1             installed
libsemanage-python.i386                   2.0.43-4.2.amzn1             installed
libxml2-python.i386                       2.7.6-1.6.amzn1              installed
policycoreutils-python.i386               2.0.82-28.1.5.amzn1          installed
python.noarch                             1:2.6-1.19.amzn1             installed
python-cheetah.i386                       2.4.1-1.6.amzn1              installed
python-configobj.noarch                   4.6.0-2.1.5.amzn1            installed
python-iniparse.noarch                    0.3.1-2.1.5.amzn1            installed
python-markdown.noarch                    2.0.1-3.1.3.amzn1            installed
python-pycurl.i386                        7.19.0-5.3.amzn1             installed
python-pygments.noarch                    1.1.1-1.3.amzn1              installed
python-setuptools.noarch                  0.6.10-1.7.amzn1             installed
python-sqlite.i386                        2.6.0-1.8.amzn1              installed
python-urlgrabber.noarch                  3.9.1-6.4.amzn1              installed
python-yaml.noarch                        3.05-1.rf.6.amzn1            installed
python26.i686                             2.6.6-1.15.amzn1             installed
python26-libs.i686                        2.6.6-1.15.amzn1             installed
rpm-python.i386                           4.8.0-9.27.amzn1             installed
setools-libs-python.i386                  3.3.6-4.1.9.amzn1            installed
MySQL-python.i386                         1.2.3-0.3.c1.1.4.amzn1       amzn     
beecrypt-python.i686                      4.1.2-10.1.1.6.amzn1         amzn     
boost-mpich2-python.i386                  1.41.0-11.3.amzn1            amzn     
boost-openmpi-python.i386                 1.41.0-11.3.amzn1            amzn     
boost-python.i386                         1.41.0-11.3.amzn1            amzn     
cracklib-python.i386                      2.8.16-2.8.amzn1             amzn     
dbus-python-devel.i386                    0.83.0-6.1.5.amzn1           amzn     
ecryptfs-utils-python.i386                82-6.6.amzn1                 amzn     
freeradius-python.i386                    2.1.9-1.3.amzn1              amzn     
graphviz-python.i386                      2.26.0-4.8.amzn1             amzn     
libbdevid-python.i686                     5.1.19.6-61.21.amzn1         amzn     
libcap-ng-python.i386                     0.6.4-2.6.amzn1              amzn     
libieee1284-python.i386                   0.2.9-4.6.amzn1              amzn     
libxcb-python.i386                        1.6-1.14.amzn1               amzn     
libxslt-python.i386                       1.1.26-1.4.amzn1             amzn     
net-snmp-python.i386                      1:5.5-21.5.amzn1             amzn     
newt-python.i386                          0.52.11-1.4.amzn1            amzn     
postgresql-plpython.i686                  8.4.5-1.6.amzn1              amzn     
python-babel.noarch                       0.9.4-5.1.2.amzn1            amzn     
python-boto.noarch                        1.9b-2.1.amzn1               amzn     
python-crypto.i386                        2.0.1-20.2.amzn1             amzn     
python-dateutil.noarch                    1.4.1-4.1.5.amzn1            amzn     
python-decoratortools.noarch              1.7-4.1.3.amzn1              amzn     
python-devel.noarch                       1:2.6-1.19.amzn1             amzn     
python-dmidecode.i386                     3.10.12-1.2.amzn1            amzn     
python-docutils.noarch                    0.6-1.2.amzn1                amzn     
python-epdb.noarch                        0.11-4.0.amzn1               amzn     
python-imaging.i386                       1.1.6-18.3.amzn1             amzn     
python-imaging-devel.i386                 1.1.6-18.3.amzn1             amzn     
python-jinja2.i386                        2.2.1-1.2.amzn1              amzn     
python-krbV.i386                          1.0.13-10.4.amzn1            amzn     
python-lcms.i386                          1.18-0.1.beta1.4.amzn1       amzn     
python-ldap.i386                          2.2.0-2.2.10.amzn1           amzn     
python-magic.i386                         5.04-4.5.amzn1               amzn     
python-paramiko.noarch                    1.7.5-2.1.2.amzn1            amzn     
python-sphinx.noarch                      0.6.3-1.2.amzn1              amzn     
python-sphinx-doc.noarch                  0.6.3-1.2.amzn1              amzn     
python24.i386                             2.4.6-27.21.amzn1            amzn     
python24-devel.i386                       2.4.6-27.21.amzn1            amzn     
python24-docs.noarch                      2.4.4-1.11.amzn1             amzn     
python24-tools.i386                       2.4.6-27.21.amzn1            amzn     
python26-devel.i686                       2.6.6-1.15.amzn1             amzn     
python26-docs.noarch                      2.6.5-1.7.amzn1              amzn     
python26-test.i686                        2.6.6-1.15.amzn1             amzn     
python26-tools.i686                       2.6.6-1.15.amzn1             amzn     
rrdtool-python.i686                       1.3.8-6.3.amzn1              amzn  

我安装了 python-devel 和 openssl-devel 并且能够构建和安装该模块。但是,我无法导入它。

>>> import OpenSSL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/OpenSSL/__init__.py", line 40, in <module>
    from OpenSSL import crypto
ImportError: /usr/lib/python2.6/site-packages/OpenSSL/crypto.so: undefined symbol: crypto_X509Extension_Type

I'm using the first default AMI for amazon Linux on ec2 and can't seem to install pyOpenSSL.
I tried:
sudo wget http://launchpad.net/pyopenssl/main/0.11/+download/pyOpenSSL-0.11.tar.gz && easy_install pyOpenSSL-0.11.tar.gz.

Results were:
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/test-easy-install-21047.write-test'

Also tried:
Results were: sudo python setup.py build

/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'zip_safe'
  warnings.warn(msg)
running build
running build_py
running build_ext
building 'OpenSSL.crypto' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.6 -c OpenSSL/crypto/crypto.c -o build/temp.linux-i686-2.6/OpenSSL/crypto/crypto.o
OpenSSL/crypto/crypto.c:13:20: error: Python.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:17,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509.h:17:25: error: openssl/ssl.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:17,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509_Type’
OpenSSL/crypto/x509.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/x509.h:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/x509.h:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/x509.h:31: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:18,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509name.h:19: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509name.h:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Name_Type’
OpenSSL/crypto/x509name.h:26: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:19,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/netscape_spki.h:16: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/netscape_spki.h:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_NetscapeSPKI_Type’
OpenSSL/crypto/netscape_spki.h:23: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:20,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509store.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509store.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Store_Type’
OpenSSL/crypto/x509store.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:21,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509req.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509req.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Req_Type’
OpenSSL/crypto/x509req.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:22,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkey.h:15: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/pkey.h:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_PKey_Type’
OpenSSL/crypto/pkey.h:22: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:23,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509ext.h:16:28: error: openssl/x509v3.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:23,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/x509ext.h:18: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/x509ext.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_X509Extension_Type’
OpenSSL/crypto/x509ext.h:27: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:24,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs7.h:15:27: error: openssl/pkcs7.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:24,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs7.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/pkcs7.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_PKCS7_Type’
OpenSSL/crypto/pkcs7.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
In file included from OpenSSL/crypto/crypto.h:25,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs12.h:14:28: error: openssl/pkcs12.h: No such file or directory
OpenSSL/crypto/pkcs12.h:15:26: error: openssl/asn1.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:25,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/pkcs12.h:17: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/pkcs12.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_PKCS12_Type’
OpenSSL/crypto/pkcs12.h:24: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/pkcs12.h:37: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:26,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/crl.h:6: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crl.h:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_CRL_Type’
OpenSSL/crypto/crl.h:13: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/crl.h:17: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:27,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/revoked.h:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_Revoked_Type’
OpenSSL/crypto/revoked.h:11: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
OpenSSL/crypto/revoked.h:15: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/revoked.h:16: error: expected ‘)’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.h:28,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/../util.h:17:25: error: openssl/err.h: No such file or directory
In file included from OpenSSL/crypto/crypto.h:28,
                 from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/../util.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/../util.h:32: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:63: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:78: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:83: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/../util.h:135: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from OpenSSL/crypto/crypto.c:15:
OpenSSL/crypto/crypto.h:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.h:74: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:75: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:76: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:77: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:78: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:80: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:81: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.h:83: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.c:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:27: error: expected ‘)’ before ‘*’ token
OpenSSL/crypto/crypto.c: In function ‘global_passphrase_callback’:
OpenSSL/crypto/crypto.c:42: error: ‘PyObject’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: error: (Each undeclared identifier is reported only once
OpenSSL/crypto/crypto.c:42: error: for each function it appears in.)
OpenSSL/crypto/crypto.c:42: error: ‘func’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: error: ‘argv’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: warning: left-hand operand of comma expression has no effect
OpenSSL/crypto/crypto.c:42: error: ‘ret’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:42: warning: left-hand operand of comma expression has no effect
OpenSSL/crypto/crypto.c:45: error: expected expression before ‘)’ token
OpenSSL/crypto/crypto.c:46: warning: implicit declaration of function ‘Py_BuildValue’
OpenSSL/crypto/crypto.c:47: warning: implicit declaration of function ‘PyEval_CallObject’
OpenSSL/crypto/crypto.c:48: warning: implicit declaration of function ‘Py_DECREF’
OpenSSL/crypto/crypto.c:49: error: ‘NULL’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:51: warning: implicit declaration of function ‘PyString_Check’
OpenSSL/crypto/crypto.c:53: warning: implicit declaration of function ‘PyErr_SetString’
OpenSSL/crypto/crypto.c:53: error: ‘PyExc_ValueError’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:56: warning: implicit declaration of function ‘PyString_Size’
OpenSSL/crypto/crypto.c:59: warning: implicit declaration of function ‘strncpy’
OpenSSL/crypto/crypto.c:59: warning: incompatible implicit declaration of built-in function ‘strncpy’
OpenSSL/crypto/crypto.c:59: warning: implicit declaration of function ‘PyString_AsString’
OpenSSL/crypto/crypto.c:59: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
OpenSSL/crypto/crypto.c: At top level:
OpenSSL/crypto/crypto.c:75: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:150: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:249: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:296: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:352: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:399: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:456: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:500: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:552: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:583: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:600: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:615: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:662: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
OpenSSL/crypto/crypto.c:707: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘crypto_methods’
OpenSSL/crypto/crypto.c: In function ‘initcrypto’:
OpenSSL/crypto/crypto.c:810: error: ‘PyObject’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:810: error: ‘c_api_object’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:812: error: ‘module’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:814: warning: implicit declaration of function ‘ERR_load_crypto_strings’
OpenSSL/crypto/crypto.c:815: warning: implicit declaration of function ‘OpenSSL_add_all_algorithms’
OpenSSL/crypto/crypto.c:820: warning: implicit declaration of function ‘Py_InitModule3’
OpenSSL/crypto/crypto.c:820: error: ‘crypto_methods’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:823: error: ‘NULL’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:829: error: ‘crypto_X509_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:830: error: ‘crypto_X509Name_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:831: error: ‘crypto_X509Req_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:832: error: ‘crypto_X509Store_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:833: error: ‘crypto_PKey_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:835: error: ‘crypto_PKCS7_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:836: error: ‘crypto_NetscapeSPKI_New’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:837: warning: implicit declaration of function ‘PyCObject_FromVoidPtr’
OpenSSL/crypto/crypto.c:839: warning: implicit declaration of function ‘PyModule_AddObject’
OpenSSL/crypto/crypto.c:842: error: ‘crypto_Error’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:842: warning: implicit declaration of function ‘PyErr_NewException’
OpenSSL/crypto/crypto.c:848: warning: implicit declaration of function ‘PyModule_AddIntConstant’
OpenSSL/crypto/crypto.c:848: error: ‘X509_FILETYPE_PEM’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:849: error: ‘X509_FILETYPE_ASN1’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:852: error: ‘EVP_PKEY_RSA’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:853: error: ‘EVP_PKEY_DSA’ undeclared (first use in this function)
OpenSSL/crypto/crypto.c:859: warning: implicit declaration of function ‘init_crypto_x509’
OpenSSL/crypto/crypto.c:861: warning: implicit declaration of function ‘init_crypto_x509name’
OpenSSL/crypto/crypto.c:863: warning: implicit declaration of function ‘init_crypto_x509store’
OpenSSL/crypto/crypto.c:865: warning: implicit declaration of function ‘init_crypto_x509req’
OpenSSL/crypto/crypto.c:867: warning: implicit declaration of function ‘init_crypto_pkey’
OpenSSL/crypto/crypto.c:869: warning: implicit declaration of function ‘init_crypto_x509extension’
OpenSSL/crypto/crypto.c:871: warning: implicit declaration of function ‘init_crypto_pkcs7’
OpenSSL/crypto/crypto.c:873: warning: implicit declaration of function ‘init_crypto_pkcs12’
OpenSSL/crypto/crypto.c:875: warning: implicit declaration of function ‘init_crypto_netscape_spki’
OpenSSL/crypto/crypto.c:877: warning: implicit declaration of function ‘init_crypto_crl’
OpenSSL/crypto/crypto.c:879: warning: implicit declaration of function ‘init_crypto_revoked’
error: command 'gcc' failed with exit status 1

I thought that I needed to make sure python devel was installed to have the headers, checked what yum had installed.
yum list | grep python yielded:

audit-libs-python.i386                    1.7.17-3.10.amzn1            installed
dbus-python.i386                          0.83.0-6.1.5.amzn1           installed
gamin-python.i386                         0.1.10-9.6.amzn1             installed
libselinux-python.i386                    2.0.94-1.6.amzn1             installed
libsemanage-python.i386                   2.0.43-4.2.amzn1             installed
libxml2-python.i386                       2.7.6-1.6.amzn1              installed
policycoreutils-python.i386               2.0.82-28.1.5.amzn1          installed
python.noarch                             1:2.6-1.19.amzn1             installed
python-cheetah.i386                       2.4.1-1.6.amzn1              installed
python-configobj.noarch                   4.6.0-2.1.5.amzn1            installed
python-iniparse.noarch                    0.3.1-2.1.5.amzn1            installed
python-markdown.noarch                    2.0.1-3.1.3.amzn1            installed
python-pycurl.i386                        7.19.0-5.3.amzn1             installed
python-pygments.noarch                    1.1.1-1.3.amzn1              installed
python-setuptools.noarch                  0.6.10-1.7.amzn1             installed
python-sqlite.i386                        2.6.0-1.8.amzn1              installed
python-urlgrabber.noarch                  3.9.1-6.4.amzn1              installed
python-yaml.noarch                        3.05-1.rf.6.amzn1            installed
python26.i686                             2.6.6-1.15.amzn1             installed
python26-libs.i686                        2.6.6-1.15.amzn1             installed
rpm-python.i386                           4.8.0-9.27.amzn1             installed
setools-libs-python.i386                  3.3.6-4.1.9.amzn1            installed
MySQL-python.i386                         1.2.3-0.3.c1.1.4.amzn1       amzn     
beecrypt-python.i686                      4.1.2-10.1.1.6.amzn1         amzn     
boost-mpich2-python.i386                  1.41.0-11.3.amzn1            amzn     
boost-openmpi-python.i386                 1.41.0-11.3.amzn1            amzn     
boost-python.i386                         1.41.0-11.3.amzn1            amzn     
cracklib-python.i386                      2.8.16-2.8.amzn1             amzn     
dbus-python-devel.i386                    0.83.0-6.1.5.amzn1           amzn     
ecryptfs-utils-python.i386                82-6.6.amzn1                 amzn     
freeradius-python.i386                    2.1.9-1.3.amzn1              amzn     
graphviz-python.i386                      2.26.0-4.8.amzn1             amzn     
libbdevid-python.i686                     5.1.19.6-61.21.amzn1         amzn     
libcap-ng-python.i386                     0.6.4-2.6.amzn1              amzn     
libieee1284-python.i386                   0.2.9-4.6.amzn1              amzn     
libxcb-python.i386                        1.6-1.14.amzn1               amzn     
libxslt-python.i386                       1.1.26-1.4.amzn1             amzn     
net-snmp-python.i386                      1:5.5-21.5.amzn1             amzn     
newt-python.i386                          0.52.11-1.4.amzn1            amzn     
postgresql-plpython.i686                  8.4.5-1.6.amzn1              amzn     
python-babel.noarch                       0.9.4-5.1.2.amzn1            amzn     
python-boto.noarch                        1.9b-2.1.amzn1               amzn     
python-crypto.i386                        2.0.1-20.2.amzn1             amzn     
python-dateutil.noarch                    1.4.1-4.1.5.amzn1            amzn     
python-decoratortools.noarch              1.7-4.1.3.amzn1              amzn     
python-devel.noarch                       1:2.6-1.19.amzn1             amzn     
python-dmidecode.i386                     3.10.12-1.2.amzn1            amzn     
python-docutils.noarch                    0.6-1.2.amzn1                amzn     
python-epdb.noarch                        0.11-4.0.amzn1               amzn     
python-imaging.i386                       1.1.6-18.3.amzn1             amzn     
python-imaging-devel.i386                 1.1.6-18.3.amzn1             amzn     
python-jinja2.i386                        2.2.1-1.2.amzn1              amzn     
python-krbV.i386                          1.0.13-10.4.amzn1            amzn     
python-lcms.i386                          1.18-0.1.beta1.4.amzn1       amzn     
python-ldap.i386                          2.2.0-2.2.10.amzn1           amzn     
python-magic.i386                         5.04-4.5.amzn1               amzn     
python-paramiko.noarch                    1.7.5-2.1.2.amzn1            amzn     
python-sphinx.noarch                      0.6.3-1.2.amzn1              amzn     
python-sphinx-doc.noarch                  0.6.3-1.2.amzn1              amzn     
python24.i386                             2.4.6-27.21.amzn1            amzn     
python24-devel.i386                       2.4.6-27.21.amzn1            amzn     
python24-docs.noarch                      2.4.4-1.11.amzn1             amzn     
python24-tools.i386                       2.4.6-27.21.amzn1            amzn     
python26-devel.i686                       2.6.6-1.15.amzn1             amzn     
python26-docs.noarch                      2.6.5-1.7.amzn1              amzn     
python26-test.i686                        2.6.6-1.15.amzn1             amzn     
python26-tools.i686                       2.6.6-1.15.amzn1             amzn     
rrdtool-python.i686                       1.3.8-6.3.amzn1              amzn  

I installed python-devel and openssl-devel and was able to build and install the module. However, I could not import it.

>>> import OpenSSL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/OpenSSL/__init__.py", line 40, in <module>
    from OpenSSL import crypto
ImportError: /usr/lib/python2.6/site-packages/OpenSSL/crypto.so: undefined symbol: crypto_X509Extension_Type

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

年少掌心2024-10-23 04:25:43

百胜安装 pyOpenSSL。一开始就应该尝试一下

yum install pyOpenSSL. Should have tried this to begin with

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文