同样的代码,用命令行运行 gvim 中的 python 代码报错,但是在 Pycharm 中运行就没有错。
错误信息是:
Traceback (most recent call last):
File "E:\Python\lib\threading.py", line 901, in _boots
self.run()
File "websocket_Demo.py", line 28, in run
sha1 = hashlib.sha1()
AttributeError: 'module' object has no attribute 'sha1'
这是怎么回事?