我需要安装一个模块txsckjs
,但是当我运行pip install txsockjs
时,它会显示一些错误,我不知道发生了什么。
错误如下:
(venv)lk@linux-7hhe:~/MyImprove/project> pip install txsockjs
Collecting txsockjs
Using cached txsockjs-1.2.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-5pxhyr0u/txsockjs/setup.py", line 73
except Exception, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5pxhyr0u/txsockjs/
答案 0 :(得分:1)
答案 1 :(得分:0)
尝试在txsockjs / setup.py中将except Exception, e
替换为except Exception as e
。
正如SilentMonk和Saket强调的那样,Python版本在这种情况下很重要。请参阅Python try…except comma vs 'as' in except和参考PEP 3110 -- Catching Exceptions in Python 3000。