이 문제가 발생할 때마다 파일을 복사하고 kali의 새 복사본을 설치한 다음 시스템을 다시 업데이트하고 앱을 다시 다운로드하기 위한 요구 사항을 복사합니다. 정확히 언제 발생하는지, 언제 발생하는지 알 수 없습니다. 해결책은 잘 작동하는 환경 활성 pip3을 사용하는 것입니다.
root@kali:~# which pip
/usr/local/bin/pip
root@kali:~# whereis pip
pip: /usr/bin/pip /usr/local/bin/pip /usr/local/bin/pip2.7
/usr/share/man/man1/pip.1.gz
root@kali:~# pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
load_entry_point('pip==18.1', 'console_scripts', 'pip')()
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 487, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2728, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2346, in load
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2352, in resolve
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/cli/main_parser.py", line 12, in <module>
from pip._internal.commands import (
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/commands/__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/commands/completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/cli/base_command.py", line 18, in <module>
from pip._internal.download import PipSession
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_internal/download.py", line 15, in <module>
from pip._vendor import requests, six, urllib3
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_vendor/requests/__init__.py", line 97, in <module>
from pip._vendor.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python2.7/dist-packages/pyOpenSSL-18.0.0-py2.7.egg/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/pyOpenSSL-18.0.0-py2.7.egg/OpenSSL/crypto.py", line 12, in <module>
from cryptography import x509
File "/usr/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 8, in <module>
from cryptography.x509.base import (
File "/usr/lib/python2.7/dist-packages/cryptography/x509/base.py", line 16, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/lib/python2.7/dist-packages/cryptography/x509/extensions.py", line 18, in <module>
from cryptography.hazmat.primitives import constant_time, serialization
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 11, in <module>
from cryptography.hazmat.bindings._constant_time import lib
AttributeError: 'module' object has no attribute '_init_cffi_1_0_external_module'
답변1
핍이 엉망이 된 경우. 그렇다면 가장 좋은 방법은 배포판에 Python을 설치하는 데 사용한 것과 동일한 패키지 시스템을 사용하여 다시 설치하는 것입니다.
다음 단계는파이썬 환경다음 방법을 사용하여 직접 문제를 해결하세요.
python -m ensurepip
python -m ensurepip --upgrade
실패하면 시도해 볼 수 있습니다부팅 스크립트- 컬로 가져오기:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
그런 다음 다음을 실행합니다.
python get-pip.py