kali-linux-python2和OpenSSL不能在Kali上一起玩 – 如何解决?
作者:互联网
我在amd64上有一个Kali Linux发行版,即Kali GNU / Linux Rolling(目前版本为2017.3).我会定期更新它并且没有干扰系统文件或包管理.然而,前段时间python2和OpenSSL一起停止播放.在一开始,这简直是奇怪的,但现在它是一个主要的麻烦.例如.像这样的简单调用失败:
# pip
/usr/lib/python2.7/dist-packages/cffi/model.py:532: UserWarning: 'point_conversion_form_t' has no values explicitly defined; guessing that it is equivalent to 'unsigned int'
% self._get_c_name())
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/__init__.py", line 52, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 59, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in <module>
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 112, in <module>
if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'FFILibrary' object has no attribute 'Cryptography_HAS_SSL_ST'
通过各种搜索引擎结果筛选我发现这似乎是一个已知的不兼容问题,但显然没有切实的清洁解决方案.令我困惑的是,在积极维护的发行版中怎么会发生这种情况? (事实上,具有相同设置的同事没有这个问题.)
是否有一种简单的方法来修复/修复此问题而无需重新安装整个发行版?
安装的版本是python / kali-rolling 2.7.14-1,python-openssl / kali-rolling 16.2.0-1和python-cffi / kali-rolling 1.9.1-2.
解决方法:
我假设您已经从分发存储库安装了pip?
如果是这样,只需删除当前版本的pip并使用get-pip.py安装它:
curl -o ./get-pip.py https://bootstrap.pypa.io/get-pip.py
python3 ./get-pip.py
python2 ./get-pip.py
这应该拉出所有适当的依赖项,你的pip将重新开始工作.
标签:python,openssl,kali-linux 来源: https://codeday.me/bug/20190816/1671211.html