python 为什么我收到无效的语法 easy_install 错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/624492/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why am I getting an invalid syntax easy_install error?
提问by Matthew Schinckel
I need to use easy_install to install a package. I installed the enthought distribution, and popped into IDLE to say:
我需要使用 easy_install 来安装一个包。我安装了 enthought 发行版,然后弹出 IDLE 说:
>>> easy_install SQLobject
SyntaxError: invalid syntax
What am I doing wrong? easy_install
certainly exists, as does the package. help('easy_install') gives me some basic help. import easy_install
doesn't change things either.
我究竟做错了什么? easy_install
肯定存在,包也是如此。help('easy_install') 给了我一些基本的帮助。 import easy_install
也不会改变。
Any hints? I know I'm missing something really basic here.
任何提示?我知道我在这里遗漏了一些非常基本的东西。
回答by Matthew Schinckel
easy_install is a shell command. You don't need to put it in a python script.
easy_install 是一个 shell 命令。你不需要把它放在 python 脚本中。
easy_install SQLobject
Type that straight into a bash (or other) shell, as long as easy_install is in your path.
只要 easy_install 在您的路径中,就直接将其输入到 bash(或其他)shell 中。