在Sage上安装wxPython的spkg包时出现语法错误

时间:2012-06-26 22:08:19

标签: python wxpython sage

当我想从here

安装软件包wxPython-2.8.7.1.spkg时

在Sage的终端,它给了我一个语法错误。我在Sage终端上写的内容和结果如下:

sage: sage -i wxPython-2.8.7.1.spkg
------------------------------------------------------------
   File "<ipython console>", line 1
     sage -i wxPython-RealNumber('2.8').gen(7).1.spkg
                    ^
SyntaxError: invalid syntax

我也使用包的直接地址,但结果是一样的:

 sage: sage -i http://www.sagemath.org/packages/experimental/wxPython-2.8.7.1.s>
------------------------------------------------------------
   File "<ipython console>", line 1
     sage -i http://www.sagemath.org/packages/experimental/wxPython-RealNumber('2.8').gen(7).1.spkg
                ^
SyntaxError: invalid syntax

我还下载了包并使用了本地地址但结果是一样的。

1 个答案:

答案 0 :(得分:1)

您需要在启动 Sage之前从命令行执行此操作。否则你可以使用

sage: install_package("wxPython")

目前正在为我下载...然后失败了:

checking for GTK+ - version >= 2.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: error:
The development files for GTK+ were not found. For GTK+ 2, please
ensure that pkg-config is in the path and that gtk+-2.0.pc is
installed. For GTK+ 1.2 please check that gtk-config is in the path,
and that the version is 1.2.3 or above. Also check that the
libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
--libs' are in the LD_LIBRARY_PATH or equivalent.
Error configure wx widgets.

real    0m13.972s
user    0m2.791s
sys 0m5.232s
************************************************************************
Error installing package wxPython-2.8.7.1
************************************************************************

沿着这些方向,这是它在the list of experimental spkgs所说的内容,其中一个是:

  

这些都是实验!他们可能根本不会为你工作!使用风险自负!其中许多从未在任何平台上成功构建!

所以买家要小心!