简体   繁体   English

python安装模块中的错误

[英]error in python install module

I need to install a module txsckjs ,but when I run pip install txsockjs it shows me some error and I don't know what happened. 我需要安装模块txsckjs ,但是当我运行pip install txsockjs它显示了一些错误,我不知道发生了什么。

The error is following: 错误如下:

(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/

It is possible that the version of Python you are using is not compatible with the given module. 您使用的Python版本可能与给定的模块不兼容。

在此处输入图片说明

I have Python 3.5.2 and was able to reporduce your error. 我拥有Python 3.5.2,并能够解决您的错误。 It should work on Python 2 I suppose. 我猜它应该可以在Python 2上工作。

Try replacing except Exception, e with except Exception as e in txsockjs/setup.py. 尝试在txsockjs / setup.py中将except Exception as e except Exception, e替换为except Exception, e except Exception as e

As underlined by SilentMonk and Saket, Python version matters in this case. 正如SilentMonk和Saket所强调的那样,在这种情况下,Python版本很重要。 See Python try…except comma vs 'as' in except and the reference, PEP 3110 -- Catching Exceptions in Python 3000 . 请参阅except中的Python try…except逗号与“ as”,以及参考文献PEP 3110-Python 3000中的捕获异常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM