忍者ブログ

素人翻訳

適当に翻訳する。

gitエラーのためcurlをインストール

[user09@localhost git-2.9.5]$ git clone https://github.com/TASEmulators/desmume
Cloning into 'desmume'...
fatal: Unable to find remote helper for 'https'
[user09@localhost git-2.9.5]$

curlが入ってないと上記のエラーが出るとのこと。

curl のソースコードをダウンロードしようとして goo.ne.jpで検索したら、一番上にgithubのcurlのページが出てきた。
gitが使えなくて困っているのだが…。

curlのサイトの「daily snapshots」からダウンロード。

openssl-1.1.1qをインストールしてある環境で、

$ cd git-2.9.5
$ export PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig"
$ export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib"
$ export CFLAGS="-I/usr/local/include"
(自分なりの環境変数を設定)
$ make clean
$ cd ..
$ tar -xf curl-7.88.1-20230220.tar.xz
$ cd curl-7.88.1-20230220
$ ./configure --with-openssl=/usr/local
(人によっては --with-openssl=/usr/local/ssl かもしれない。)
$ make
$ sudo make install
$ cd ../git-2.9.5
$ ./configure
...
...
checking for curl_global_init in -lcurl... yes
checking for Curl_ssl_init in -lcurl... no
checking for curl-config... curl-config
...
...
$ ./configure --with-curl=/usr/local
...
...
checking for curl_global_init in -lcurl... yes
checking for Curl_ssl_init in -lcurl... no
checking for curl-config... curl-config
...
...
$ make
$ sudo make install

「checking for Curl_ssl_init in -lcurl... no」のままだが、「git clone https://〜〜」は成功した。

/usr/local/libexec/git-coreの中に「git-remote-https」ができている。

PR

python-2.7.18をソースコードからインストール

zlib-1.2.11
openssl-1.1.0l
を先にインストールしておく。

zlibがない場合、

...
...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/runpy.py", line 165, in _run_module_as_main
mod_name, loader, code, fname = _get_main_module_details(_Error)
File "/usr/local/lib/python2.7/runpy.py", line 133, in _get_main_module_details
return _get_module_details(main_name)
File "/usr/local/lib/python2.7/runpy.py", line 121, in _get_module_details
raise error(format(e))
ImportError: can't decompress data; zlib not available
[user001]$

...................

opensslをインストールしたのにエラーが出る。

[user001]$ (pythonスクリプト)
...
...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
...
...
File "/usr/local/lib/python2.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
[user001]$

libssl.soなどは/usr/local/lib64に存在し、
「ldconfig -p | grep ssl」
といったコマンドで問題なく表示される。

下記のサイトによると「import ssl」のエラーと「import _ssl」のエラーは違うらしい。
https://stackoverflow.com/questions/32856389/how-to-import-ssl-in-python-2-7-6

解決方法を記した日本語のサイトがあった。

山田 徹 | 読み込み中です。
https://yamadablog.web.fc2.com/articles/14/index.html

このサイトの真似をして「Python-2.7.18/Modules/Setup」の216行目〜222行目あたりのコメントアウトを外し、

...
...
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
...
...

に書き換えて、

make clean
./configure --with-openssl=/usr/local
make
sudo make install

で解決。

「山田 徹 | 読み込み中です。」より引用、

できましたか?sslないとpipとか使えませんからね。
もうちょっとPythonも楽にインストールできたらいいんですけどね〜(いや、簡単なapt-get使え)
...
...
...
世界に、私のようなソースコードからインストールするマニア(暇人() )がいることを信じて...

山田徹さん、ありがとう。

...................

SSLに関して別のエラー有り。

youtube-dlを使った時、下記のエラーが出た。

[user001]$ ./youtube-dl (URL)
...
...
WARNING: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>
...
ERROR: Unable to download API page: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)'),))
[user001]$

自作のopensslが「ca-bundle.crt」等を見つけられない状態。

元から使っていた「ca-bundle.crt」が「/etc/ssl/certs」にあったので、

[user001]$ export SSL_CERT_FILE="/etc/ssl/certs/ca-bundle.crt"
[user001]$

これで解決。
.bashrcに「export SSL_CERT_FILE="/etc/ssl/certs/ca-bundle.crt"」を追記しておく。

カレンダー

02 2024/03 04
S M T W T F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
18 19 20 21 22 23
24 25 26 27 28 29 30
31

最新コメント

[08/18 NONAME]
[05/18 NONAME]
[04/09 NONAME]
[03/21 NONAME]
[03/20 NONAME]

最新記事

ブログ内検索

広告

バーコード

広告