#19622: Automatic error message when packages are not installed
----------------------------------+-------------------------
       Reporter:  jdemeyer        |        Owner:
           Type:  defect          |       Status:  new
       Priority:  minor           |    Milestone:  sage-6.10
      Component:  user interface  |   Resolution:
       Keywords:                  |    Merged in:
        Authors:  Jeroen Demeyer  |    Reviewers:
Report Upstream:  N/A             |  Work issues:
         Branch:                  |       Commit:
   Dependencies:                  |     Stopgaps:
----------------------------------+-------------------------
Description changed by jdemeyer:

Old description:

> How to install `bliss`?
>
> {{{
> sage: G = graphs.PetersenGraph()
> sage: G.automorphism_group(algorithm='bliss')
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call
> last)
> <ipython-input-2-8e034558a836> in <module>()
> ----> 1 G.automorphism_group(algorithm='bliss')
>
> /usr/local/src/sage-config/local/lib/python2.7/site-
> packages/sage/graphs/generic_graph.pyc in automorphism_group(self,
> partition, verbosity, edge_labels, order, return_group, orbits,
> algorithm)
>   20074                 from sage.graphs.bliss import automorphism_group
>   20075             except ImportError:
> > 20076                 raise ImportError("You must install the 'bliss'
> package to run this command.")
>   20077
>   20078             A = automorphism_group(self, partition)
>
> ImportError: You must install the 'bliss' package to run this command.
> }}}

New description:

 We add some magic to the Sage setup scripts such that `OptionalExtension`s
 whose package is not installed automatically raise an user-friendly
 exception:

 {{{
 sage: G = graphs.PetersenGraph()
 sage: G.automorphism_group(algorithm='bliss')
 ---------------------------------------------------------------------------
 PackageNotFoundError                      Traceback (most recent call
 last)
 <ipython-input-2-8e034558a836> in <module>()
 ----> 1 G.automorphism_group(algorithm='bliss')

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/graphs/generic_graph.pyc in automorphism_group(self,
 partition, verbosity, edge_labels, order, return_group, orbits, algorithm)
   20062             if edge_labels:
   20063                 raise ValueError("bliss cannot be used when
 edge_labels is True")
 > 20064             from sage.graphs.bliss import automorphism_group
   20065
   20066             A = automorphism_group(self, partition)

 PackageNotFoundError: the package 'bliss' was not found. You can install
 it by running 'sage -i bliss' in a shell
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/19622#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to