LoginSignup
4
4

More than 5 years have passed since last update.

PyOpenSSLのインストール(CentOS 6.7)

Last updated at Posted at 2016-06-30

発端

p12ファイルを使った認証を含むpythonスクリプトを走らせたところ、
以下のようなエラーが。

[root@localhost home]# python some.py
/略
NotImplementedError:
This library only implements PKCS#12 support via the pyOpenSSL library.
Either install pyOpenSSL, or please convert the .p12 file

PyOpenSSLのインストール(一回目)

なるほど、pyOpenSSLをインストールすればいいのか…

[root@localhost home]# pip install pyOpenSSL
/略
 error: command 'gcc' failed with exit status 1
/略

失敗。
まさかgccがないとか?

gccのインストール

[root@localhost home]# yum install gcc
/略
完了しました!

よし。

python-devel, openssl-devel, libffi-develのインストール

しかし、もう一回pip install pyOpenSSLするとまた同じエラーが。
調べると、python-devel, openssl-devel, libffi-develが必要とのこと。
そこで、

[root@localhost home]# yum install python-devel
/略
完了しました!
[root@localhost home]# yum install openssl-devel
/略
完了しました!
[root@localhost home]# yum install libffi-devel
/略
完了しました!

pyOpenSSLのインストール(二回目)

もう一度、pip install pyOpenSSLすると

Successfully installed cffi-1.7.0 cryptography-1.4 pyOpenSSL-16.0.0

ということで、もとのスクリプトも動いた動いた。
よかったよかった。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4