{"id":431,"date":"2021-05-27T13:31:11","date_gmt":"2021-05-27T05:31:11","guid":{"rendered":"http:\/\/0004.xyz\/?p=431"},"modified":"2021-05-27T13:31:11","modified_gmt":"2021-05-27T05:31:11","slug":"centos7-python3-7-pip%e5%ae%89%e8%a3%85%e6%89%be%e4%b8%8d%e5%88%b0tls-ssl%e5%a4%84%e7%90%86%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"http:\/\/0004.xyz\/?p=431","title":{"rendered":"CentOS7 Python3.7 pip\u5b89\u88c5\u627e\u4e0d\u5230TLS\/SSL\u5904\u7406\u65b9\u5f0f"},"content":{"rendered":"<p>\u5b89\u88c5python3.7\u540e\uff0cpip\u5728\u5b89\u88c5\u5305\u7684\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u201cpip is configured with locations that require TLS\/SSL, however the ssl module in Python is not available.\u201d\u9519\u8bef\u3002\u5728\u5b89\u88c5openssl-devel\uff0copenssl\u540e\u91cd\u65b0\u7f16\u8bd1python3.7\u5747\u65e0\u6cd5\u8fd0\u884cpip\uff0c\u5219\u9700\u8981\u66f4\u65b0openssl\u7248\u672c\u4e3a1.1.1k\uff0c\u4ee5\u4e0b\u4e3a\u5b89\u88c5\u8fc7\u7a0b\u3002<\/p>\n<h2>1\u3001\u4e0b\u8f7d\u5b89\u88c5openssl<\/h2>\n<pre><code class=\"language-shell\">wget https:\/\/www.openssl.org\/source\/openssl-1.1.1k.tar.gz\ntar -zxvf openssl-1.1.1k.tar.gz\ncd openssl-1.1.1k\n.\/config --prefix=\/usr\/local\/openssl no-zlib\nmake\nmake install<\/code><\/pre>\n<h2>2\u3001\u5907\u4efd\u539fopenssl<\/h2>\n<pre><code class=\"language-shell\">mv \/usr\/bin\/openssl \/usr\/bin\/openssl.bak\nmv \/usr\/include\/openssl\/ \/usr\/include\/openssl.bak<\/code><\/pre>\n<h2>3\u3001\u5efa\u7acbopenssl1.1.1k\u8f6f\u8fde\u63a5<\/h2>\n<pre><code class=\"language-shell\">ln -s \/usr\/local\/openssl\/include\/openssl \/usr\/include\/openssl\nln -s \/usr\/local\/openssl\/lib\/libssl.so.1.1 \/usr\/local\/lib64\/libssl.so\nln -s \/usr\/local\/openssl\/bin\/openssl \/usr\/bin\/openssl<\/code><\/pre>\n<h2>4\u3001openssl\u5e93\u6587\u4ef6\u914d\u7f6e\u641c\u7d22<\/h2>\n<pre><code class=\"language-shell\">echo &quot;\/usr\/local\/openssl\/lib&quot; &gt;&gt; \/etc\/ld.so.conf\nldconfig -v #\u4f7f\u4fee\u6539\u540e\u7684\/etc\/ld.so.conf\u751f\u6548<\/code><\/pre>\n<h2>5\u3001\u91cd\u65b0\u5b89\u88c5python<\/h2>\n<pre><code class=\"language-shell\">cd Python-3.7.0\n.\/configure --with-openssl=\/usr\/local\/openssl\nmake\nmake install<\/code><\/pre>\n<h2>6\u3001\u7ed3\u675f<\/h2>\n<p>\u81f3\u6b64pip\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u4e86\uff0c\u7ee7\u7eed\u8fdb\u884c\u4e0b\u90e8\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5python3.7\u540e\uff0cpip\u5728\u5b89\u88c5\u5305\u7684\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u201cpip is configured with locat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"kt_blocks_editor_width":"","footnotes":""},"categories":[17],"tags":[8,568,569],"class_list":["post-431","post","type-post","status-publish","format-standard","hentry","category-share","tag-centos","tag-pip","tag-python"],"_links":{"self":[{"href":"http:\/\/0004.xyz\/index.php?rest_route=\/wp\/v2\/posts\/431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/0004.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/0004.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/0004.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/0004.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=431"}],"version-history":[{"count":0,"href":"http:\/\/0004.xyz\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions"}],"wp:attachment":[{"href":"http:\/\/0004.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/0004.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/0004.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}