简体   繁体   中英

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.

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.

在此处输入图片说明

I have Python 3.5.2 and was able to reporduce your error. It should work on Python 2 I suppose.

Try replacing except Exception, e with except Exception as e in txsockjs/setup.py.

As underlined by SilentMonk and Saket, Python version matters in this case. See Python try…except comma vs 'as' in except and the reference, PEP 3110 -- Catching Exceptions in Python 3000 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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