Sage not finding Gambit's command line tools

44 views
Skip to first unread message

James Campbell

unread,
Jun 9, 2014, 9:51:40 AM6/9/14
to sage-s...@googlegroups.com
Hi,

I'm trying to get Gambit working as an external package.
I followed through the steps about packaging third party code and I'm now at the stage where running ``import gambit`` within sage does not raise any errors.
I have access to to the majority of the functionality within gambit, however, Gambit has some function which rely on a corresponding command line tool.
I can see that these have appeared in 'SAGE_ROOT/local/bin` but when I try to use them within sage I get the error `'module' object has no attribute 'nash'` for example.

Is there something I've forgotten to do?
all help is greatly appreciated, thanks

Dima Pasechnik

unread,
Jun 11, 2014, 4:44:00 AM6/11/14
to sage-s...@googlegroups.com
On 2014-06-09, James Campbell <james.c...@tanti.org.uk> wrote:
> Hi,
>
> I'm trying to get Gambit <http://gambit.sourceforge.net/> working as an
> external package.
> I followed through the steps about packaging third party
><http://www.sagemath.org/doc/developer/packaging.html> code and I'm now at
> the stage where running ``import gambit`` within sage does not raise any
> errors.
> I have access to to the majority of the functionality within gambit,
> however, Gambit has some function which rely on a corresponding command
> line tool <http://gambit.sourceforge.net/gambit13/pyapi.html>.
> I can see that these have appeared in 'SAGE_ROOT/local/bin` but when I try
> to use them within sage I get the error `'module' object has no attribute
> 'nash'` for example.
>
> Is there something I've forgotten to do?
> all help is greatly appreciated, thanks

did you install them using 'sage -sh' ?

Are you able to run these tools using Sage's python (i.e. from 'sage
--python') ?

If the latter works this means there are some incompatibilities
with most probably Sage's preparser and the code in question.
(fixable, but not instantly...)





leif

unread,
Jun 11, 2014, 11:11:43 AM6/11/14
to sage-s...@googlegroups.com
James Campbell wrote:
> Hi,
>
> I'm trying to get Gambit <http://gambit.sourceforge.net/> working as an
> external package.
> I followed through the steps about packaging third party
> <http://www.sagemath.org/doc/developer/packaging.html> code and I'm now
> at the stage where running ``import gambit`` within sage does not raise
> any errors.
> I have access to to the majority of the functionality within gambit,
> however, Gambit has some function which rely on a corresponding command
> line tool <http://gambit.sourceforge.net/gambit13/pyapi.html>.
> I can see that these have appeared in 'SAGE_ROOT/local/bin` but when I
> try to use them within sage I get the error `'module' object has no
> attribute 'nash'` for example.
>
> Is there something I've forgotten to do?

Well, hard to tell without looking at your package.

Is it available somewhere? Trac ticket?


-leif

P.S.: This seems to be more suited to discuss on sage-devel.

--
() The ASCII Ribbon Campaign
/\ Help Cure HTML E-Mail

James Campbell

unread,
Jun 13, 2014, 3:47:55 AM6/13/14
to sage-s...@googlegroups.com
Yes I did install using sage -sh.

No, I haven't tried using them within Sage's python. If they don't work there
what would be the solution?

Thanks for the help
James

Vince

unread,
Jun 13, 2014, 3:55:24 AM6/13/14
to sage-s...@googlegroups.com


On Wednesday, June 11, 2014 4:11:43 PM UTC+1, leif wrote:
James Campbell wrote:
> Hi,
>
> I'm trying to get Gambit <http://gambit.sourceforge.net/> working as an
> external package.
> I followed through the steps about packaging third party
> <http://www.sagemath.org/doc/developer/packaging.html> code and I'm now
> at the stage where running ``import gambit`` within sage does not raise
> any errors.
> I have access to to the majority of the functionality within gambit,
> however, Gambit has some function which rely on a corresponding command
> line tool <http://gambit.sourceforge.net/gambit13/pyapi.html>.
> I can see that these have appeared in 'SAGE_ROOT/local/bin` but when I
> try to use them within sage I get the error `'module' object has no
> attribute 'nash'` for example.
>
> Is there something I've forgotten to do?

Well, hard to tell without looking at your package.

Is it available somewhere?  Trac ticket?

You can find a github repository here: https://github.com/theref/sage-game-theory/tree/16333 (that's the branch to the corresponding trac ticket which you can find here: http://trac.sagemath.org/ticket/16333)
 

-leif

P.S.:  This seems to be more suited to discuss on sage-devel.


I completely agree, apologies for the late reply, James (student who is working on this) had missed your replies which are very much appreciated.

Dima Pasechnik

unread,
Jun 13, 2014, 4:58:31 AM6/13/14
to sage-s...@googlegroups.com
On 2014-06-13, James Campbell <james.c...@tanti.org.uk> wrote:
> Yes I did install using sage -sh.
>
> No, I haven't tried using them within Sage's python. If they don't work
> there
> what would be the solution?
then it means that Gambit has hard time whenever your Python etc is
not at a "standard" location.

E.g. it could happen that a setup.py hardcodes a path to something
like /usr/local/...
This would need to be fixed.
A similar situation happens with cvxopt, where Sage has to patch
setup.py
Have a look at
https://github.com/sagemath/sage/tree/master/build/pkgs/cvxopt
in particular
https://github.com/sagemath/sage/blob/master/build/pkgs/cvxopt/patches/setup.py.patch

HTH,
Dima


James Campbell

unread,
Jun 13, 2014, 5:01:24 AM6/13/14
to sage-s...@googlegroups.com
Ok, thanks for all your help! I'll see what I can get sorted.

James 
Reply all
Reply to author
Forward
0 new messages