Pycharm:AttributeError: module 'HTMLTestRunner' has no attribute 'HTMLTes...
1、使用Pycharm插件直接安装HTMLTestRunner报错
2、pip升级后,shell命令安装失败
3、通过Pycharm安装下载HTMLTestRunner-Python3
默认会安装到项目目录下lib/python3.8/lib/site-packages下,但会出现报错
AttributeError: module 'HTMLTestRunner' has no attribute 'HTMLTestRunner'
4、把HTMLTestRunner.py 文件复制到Python3 安装路径下的lib文件夹中即可。
小提示:
在python3中用HTMLTestRunner.py报importError“:No module named 'StringIO'解决办法
原因是官网的是python2语法写的,看官手动把官网的HTMLTestRunner.py改成python3的语法。修改内容:
第94行,将import StringIO修改成import io第539行,将self.outputBuffer = StringIO.StringIO()修改成self.outputBuffer = io.StringIO()第642行,将if not rmap.has_key(cls):修改成if not cls in rmap:
第631行,将print >> sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime)修改成print(sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime))
第766行,将uo = o.decode('latin-1')修改成uo = e第775行,将ue = e.decode('latin-1')修改成ue = e
相关推荐
-
成功解决AttributeError: module 'numpy' has no attribute 'integer'
成功解决AttributeError: module 'numpy' has no attribute 'integer' 解决问题 AttributeError: module 'numpy' ha ...
-
成功解决AttributeError: 'str' object has no attribute 'decode'
成功解决AttributeError: 'str' object has no attribute 'decode' 解决问题 AttributeError: 'str' object has no ...
-
成功解决AttributeError: module 'enum' has no attribute 'IntFlag'?
成功解决AttributeError: module 'enum' has no attribute 'IntFlag'? 解决问题 AttributeError: module 'enum' has ...
-
成功解决AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'
成功解决AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' 解决问题 File ...
-
成功解决 AttributeError: module 'tensorflow' has no attribute 'sub'
成功解决 AttributeError: module 'tensorflow' has no attribute 'sub' 解决问题 AttributeError: module 'tensorf ...
-
成功解决AttributeError: module 'torch.utils' has no attribute 'data'
成功解决AttributeError: module 'torch.utils' has no attribute 'data' 解决问题 AttributeError: module 'torch. ...
-
成功解决AttributeError: 'BasicLSTMCell' object has no attribute '_kernel'+python下划线用法的几种常见用法理解
成功解决AttributeError: 'BasicLSTMCell' object has no attribute '_kernel'+python下划线用法的几种常见用法理解 解决问题 Attr ...
-
成功解决AttributeError: module tensorflow.image has no attribute resize
成功解决AttributeError: module tensorflow.image has no attribute resize 解决问题 AttributeError: module 'ten ...
-
TF版本升级问题:成功解决AttributeError: module tensorflow has no attribute mul
TF版本升级问题:成功解决AttributeError: module 'tensorflow' has no attribute 'mul' 解决问题 AttributeError: module ...
-
成功解决AttributeError: module 'tensorflow' has no attribute 'scalar_summary'
成功解决AttributeError: module 'tensorflow' has no attribute 'scalar_summary' 解决问题 AttributeError: modul ...
-
成功解决AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython
成功解决AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython ...
-
成功解决AttributeError: module tensorflow has no attribute lite
成功解决AttributeError: module tensorflow has no attribute lite 解决问题 self.interp_palm = tf.lite.Interpre ...
-
成功解决AttributeError: module 'tensorflow' has no attribute 'histogram_summary'
成功解决AttributeError: module 'tensorflow' has no attribute 'histogram_summary' 解决问题 AttributeError: mo ...
-
成功解决AttributeError: module 'string' has no attribute 'find'
成功解决AttributeError: module 'string' has no attribute 'find' 解决问题 AttributeError: module 'string' has ...
-
成功解决AttributeError: module 'tensorflow.python.keras' has no attribute 'Model'
成功解决AttributeError: module 'tensorflow.python.keras' has no attribute 'Model' 解决问题 File "object ...
-
成功解决AttributeError: module 'tensorflow.python.training.training' has no attribute 'SummaryWriter'
成功解决AttributeError: module 'tensorflow.python.training.training' has no attribute 'SummaryWriter' 解决 ...
-
成功解决 class 'AttributeError' : 'Editor' object has no attribute '_Editor__markerMap'
成功解决 class 'AttributeError' : 'Editor' object has no attribute '_Editor__markerMap' 解决问题 An error lo ...
-
成功解决AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries'
成功解决AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries' 解决问题 AttributeError: ...
-
成功解决AttributeError: module tensorflow.sets has no attribute intersection
成功解决AttributeError: module tensorflow.sets has no attribute intersection 解决问题 AttributeError: modu ...