pip install pydot raises a SyntaxError

巧了我就是萌 提交于 2019-12-02 05:53:33

问题


I'm running pip from the command line, trying to install pydot because Django's django-extensions needs it to generate UML class diagrams

When I run the command pip install pydot, it gives me this error:

Collecting pydot
  Using cached pydot-1.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "C:\Users\[me]\AppData\Local\Temp\pip-build-uscu27_d\pydot\setup.py
", line 5
        except ImportError, excp:
                          ^
    SyntaxError: invalid syntax

The same error happens with easy_install pydot.

Looks like the correct syntax would be except ImportError as excp, but I don't know what to do about this. The version of Python I'm using is 3.4.3. Do I have to downgrade my version of Python to get this to work, or is there some other way?


回答1:


This error is due to the old exception syntax of python2.

Since pydot seems to be a very old library and no longer maintained, I'd suggest forking it and correct this error yourself.



来源:https://stackoverflow.com/questions/33249371/pip-install-pydot-raises-a-syntaxerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!