错误:
Traceback (most recent call last):
File "dingdang.py", line 11, in <module>
from client import tts
File "/home/youzinan/zhou/robot/dingdang-robot-master/client/tts.py", line 32, in <module>
from . import diagnose
File "/home/youzinan/zhou/robot/dingdang-robot-master/client/diagnose.py", line 10, in <module>
import pip.req
ImportError: No module named req
解决方案:
方案1
直接升级pip无效
方案2
直接在原函数中把import改为直接添加代码函数
def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]