我正在从源代码安装python 3.6.9。我按照下面的link安装python。但是,当我尝试导入 ssl 库时,我遇到了问题。
我遇到的错误是 1. wget http://www.openssl.org/source/openssl-1.0.2e.tar.gz
2. ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
3. $ make
$ make test
$ make install
4. wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
5. tar xJf Python-3.6.9.tar.xz
6. vim Modules/Setup.dist
uncommented the ssl code
_socket socketmodule.c
# 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 _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
7. ./configure
make
make install
。
我遵循此link来从源代码安装openssl,但仍然遇到相同的错误。我不知道我在想什么。我在openssl安装后重新编译了python,但仍然收到相同的错误。
我不能使用yum,因为我的linux环境不支持Internet。
更新: 我提到的步骤如下所述。
CMD /etc/init.d/cron start