ImportError: No module named 'distutils.version'?
1、我使用 mitmdump 进行抓取数据时,报了个错误,一直查找解决分案,报错信息如下程序代码:
C:\Windows\System32>mitmdump -s E:\Python开发\DataTest\酷狗\KGRequestProvider.py Loading script: E:\Python开发\DataTest\酷狗\KGRequestProvider.py Script error: Traceback (most recent call last): File "E:\Python开发\DataTest\酷狗\KGRequestProvider.py", line 10, in <module> import redis File "C:\Users\youziku\AppData\Roaming\Python\Python36\site-packages\redis\__init__.py", line 1, in <module> from redis.client import Redis, StrictRedis File "C:\Users\youziku\AppData\Roaming\Python\Python36\site-packages\redis\client.py", line 12, in <module> from redis.connection import (ConnectionPool, UnixDomainSocketConnection, File "C:\Users\youziku\AppData\Roaming\Python\Python36\site-packages\redis\connection.py", line 2, in <module> from distutils.version import StrictVersion ImportError: No module named 'distutils.version'
2、这个是我引用的模块
程序代码:
import sys sys.path.append('C:\\Users\\youziku\\AppData\\Roaming\\Python\\Python36\\site-packages') import json import redis from distutils.version import StrictVersion
3、Python版本如下
C:\Windows\System32>python -V Python 3.6.3
4、redis版本如下
程序代码:
C:\Windows\System32>pip show redis WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https:// for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Name: redis Version: 3.5.2 Summary: Python client for Redis key-value store Home-page: https:// Andy McCurdy Author-email: sedrik@ MIT Location: c:\users\youziku\appdata\roaming\python\python36\site-packages Requires: Required-by: scrapy-redis