我下载了ActivePython-2.7.2.5-win32-x86,并按照文档中的说明安装了软件。但是pypm根本不起作用。从文档中,我相信在成功安装Python之后,我只需要在IDLE (Python GUI)中使用以下代码:
C:\> pypm install pandas 来安装和加载程序包。但是,我一直收到如下所示的语法错误
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> C:\> pypm install pyramid
SyntaxError: invalid syntax当我尝试运行相同的代码时,我也得到了相同的错误信息:
C:\> pypm install pandas 在Python交互式shell中,如下所示:
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> C:\> pypm install pyramid
File "<stadin>", line 1
C:\> pypm install pyramid
^
SyntaxError: invalid syntax我确实尝试打开Python Package Manager (PyPM)来检查那里是否有什么问题。我在PyPM窗口中找到了以下几行:
'pypm' is not recognized as an internal or external command,
operable program or hatch file.
C:\windows\system32>我真的不知道我哪里做错了,我尝试卸载ActivePython 2.7.2.5并重新安装了几次,我仍然得到相同的错误信息。
当我输入的时候
pypm install pandas在Python交互式shell中,如下所示:
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> pypm install pyramid
File "<stadin>", line 1
pypm install pyramid
^
SyntaxError: invalid syntax仍然是相同的错误消息。
我尝试卸载ActivePython 2.7.2.5并重新安装了几次,仍然收到相同的错误消息。我使用的是Windows 7操作系统。
发布于 2013-03-02 15:19:40
您不能调用
pypm install pyramid在Python解释器提示符下。
您必须在命令行控制台/shell中键入此命令。
发布于 2014-12-05 05:57:43
我遇到了同样的问题。然而,给出的答案并不完全准确。
在最近安装了ActivePython 2.7.8.10的Windows上,我尝试执行与OP相同的操作,但得到了相同的错误消息。当我遇到这个问题时,我也在使用Python 2.7.8 shell。
“正确答案”是在PythonPython2.7的文件夹中,有一个ActiveState Package Manager (PyPM)的图标。启动此图标将打开一个命令提示符窗口,其中包含以下内容:
Python PyPM 1.4.3 (Python package Manager)简要帮助:输入"pypm install PACKAGE“来安装一个包。键入"pypm搜索关键字“以搜索包。键入"pypm upgrade“以升级已安装的软件包。
键入"pypm help“以显示完整的帮助。C:\Windows\system32>
在这里,我可以输入命令来运行pypm并安装我想要的包。
需要注意的一点。这只适用于ActiveState Python包。其他的python包没有安装PyPM --所以如果您想继续使用其他的Python发行版,就必须先弄清楚如何安装它。
https://stackoverflow.com/questions/15171834
复制相似问题