Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python引用旧的OpenSSL_Python_Macos_Openssl - Fatal编程技术网

Python引用旧的OpenSSL

Python引用旧的OpenSSL,python,macos,openssl,Python,Macos,Openssl,这听起来可能像是问题的复制品,但不仅所有的解决方案都不起作用,而且问题本身也相当古老,同时事情可能已经发生了变化 以下是我的问题: $ python -c "import ssl; print ssl.OPENSSL_VERSION" OpenSSL 0.9.8zg 14 July 2015 $ openssl version OpenSSL 1.0.1e 11 Feb 2013 我试图运行一个python脚本,它告诉我“OpenSSL 0.9.8不再受支持”。正如您所看到的,我在我的机器(O

这听起来可能像是问题的复制品,但不仅所有的解决方案都不起作用,而且问题本身也相当古老,同时事情可能已经发生了变化

以下是我的问题:

$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zg 14 July 2015
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
我试图运行一个python脚本,它告诉我“OpenSSL 0.9.8不再受支持”。正如您所看到的,我在我的机器(OSX 10.10.5)上安装了OpenSSL,它是正确的版本,但出于某种原因,Python(2.7.12)引用了旧版本。怎么办

谢谢

编辑:

让我添加几个输出,让大家都看到我遵循了其他StackOverflow主题中给出的所有说明:

$ which openssl
/opt/local/bin/openssl
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
$ brew update
Already up-to-date.
$ brew install openssl
Warning: openssl-1.0.2h_1 already installed
$ brew link --force openssl
Warning: Already linked: /usr/local/Cellar/openssl/1.0.2h_1
To relink: brew unlink openssl && brew link openssl
$ openssl version -a
OpenSSL 1.0.1e 11 Feb 2013
built on: Tue Feb 26 05:00:07 PST 2013
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(ptr,char) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: /usr/bin/clang -fPIC -fno-common -DOPENSSL_PIC -DZLIB  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/opt/local/etc/openssl"
$ brew install python --with-brewed-openssl   
Warning: python-2.7.12 already installed
$ sudo ln -s /usr/local/Cellar/python/2.7.8_2/bin/python /usr/local/bin/python
Password:
ln: /usr/local/bin/python: File exists
$ python --version
Python 2.7.12
$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zg 14 July 2015

是的,都是已知资源。我编辑了这篇文章,以便您可以看到我的控制台对所提供的解决方案中列出的所有命令的输出。您似乎没有遵循
brew取消openssl的链接
和后续的重新链接。关于图像库,
otool-L
告诉您什么?当您启用时会得到什么?