C:\Users\lzc>mitmdump --version
Traceback (most recent call last):
File "d:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "d:\Anaconda3\Scripts\mitmdump.exe\__main__.py", line 7, in <module>
File "d:\anaconda3\lib\site-packages\mitmproxy\tools\_main.py", line 152, in mitmdump
from mitmproxy.tools import dump
File "d:\anaconda3\lib\site-packages\mitmproxy\tools\dump.py", line 1, in <module>
from mitmproxy import addons
File "d:\anaconda3\lib\site-packages\mitmproxy\addons\__init__.py", line 13, in <module>
from mitmproxy.addons import proxyauth
File "d:\anaconda3\lib\site-packages\mitmproxy\addons\proxyauth.py", line 3, in <module>
import ldap3
File "d:\anaconda3\lib\site-packages\ldap3\__init__.py", line 139, in <module>
from .core.connection import Connection
File "d:\anaconda3\lib\site-packages\ldap3\core\connection.py", line 44, in <module>
from ..operation.compare import compare_operation, compare_request_to_dict
File "d:\anaconda3\lib\site-packages\ldap3\operation\compare.py", line 28, in <module>
from ..operation.search import ava_to_dict
File "d:\anaconda3\lib\site-packages\ldap3\operation\search.py", line 41, in <module>
from pyasn1.error import PyAsn1UnicodeDecodeError
ImportError: cannot import name 'PyAsn1UnicodeDecodeError' from 'pyasn1.error' (d:\anaconda3\lib\site-packages\pyasn1\error.py)
解决方法:
1、先卸载
C:\Users\lzc>pip uninstall pyasn1
Found existing installation: pyasn1 0.4.4
Uninstalling pyasn1-0.4.4:
Would remove:
d:\anaconda3\lib\site-packages\pyasn1-0.4.4-py3.7.egg-info
d:\anaconda3\lib\site-packages\pyasn1\*
Proceed (y/n)? y
Successfully uninstalled pyasn1-0.4.4
2、重新安装
C:\Users\lzc>pip install pyasn1
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pyasn1/
Collecting pyasn1
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
ERROR: mitmproxy 5.1.1 has requirement ruamel.yaml<0.17,>=0.16, but you'll have ruamel-yaml 0.15.46 which is incompatible.
Installing collected packages: pyasn1
Successfully installed pyasn1-0.4.8