[sage-support] Re: How to use notebook in sage 9.0?

2020-05-07 Thread slelievre
2020-05-06 17:58:09 UTC, Szabolcs Horvát:
>
> I use sage 9.0 and sage 8.9 on macOS. I compiled them
> myself so I would gain access to other ILP solvers than GLPK.
>
> They work fine in command line mode. But if I start Sage 9.0
> as sage --notebook, it gives me an interface to create a new
> notebook, which only has the kernel "Sage 8.9".  How can
> I get the Sage 9.0 kernel?
>
> This help page is not helpful:
>
> 
https://doc.sagemath.org/html/en/reference/repl/sage/repl/ipython_kernel/install.html
>
> It does not explain how to install the kernel.

Building several versions of SageMath on macOS
does not seem to install a Jupyter kernel for each,
maybe because each new build sees a Jupyter kernel
for Sage already exists at the desired location.

Maybe this is something we should improve. In any
case thanks for asking, and here are, at least,
some ways to sort this out "by hand".

To figure out where your kernels are installed, run:

$ sage --jupyter kernelspec list

This might answer something like:

Available kernels:
  python3 /Users/name/Library/Jupyter/kernels/python3
  sagemath/Users/name/Library/Jupyter/kernels/sagemath

To change what the SageMath kernel is doing, you can edit
the file

/Users/name/Library/Jupyter/kernels/sagemath/kernel.json

To have a Jupyter kernel for each SageMath version,
you can rename or duplicate the folder and create:

/Users/name/Library/Jupyter/kernels/sagemath-8.9
/Users/name/Library/Jupyter/kernels/sagemath-9.0

and edit the `kernel.json` files in there.

These `kernel.json` files might look something like:

```
{
"argv":
[
"/path/to/sagemath/local/bin/sage",
"--python",
"-m",
"sage.repl.ipython_kernel",
"-f", "{connection_file}"
],
"display_name": "SageMath 9.0",
"language": "sage"
}
```

So fixing it is just a matter of changing the path
in the first item of the "argv" list.

Make sure to use different "display_name" values
for the different kernels you install there.
Initially they will say

"display_name": "SageMath",

so maybe use

"display_name": "SageMath-8.9",

and

"display_name": "SageMath-9.0",

to make them different.

If you would prefer to copy Sage's actual Jupyter kernel
than making up your own, you can locate it in the Sage
tree as follows.

Change to your Sage folder (repeat for each version of Sage,
replacing `/path/to/sagemath` with the actual folder for it):

$ cd /path/to/sagemath
$ find . -name "kernel.json"

This will give you a result like:

./local/share/jupyter/kernels/python3/kernel.json
./local/share/jupyter/kernels/sagemath/kernel.json

You can then copy `./local/share/jupyter/kernels/sagemath`
to say `/Users/name/Library/Jupyter/kernels/sagemath-x.y` --
use the folder revealed by `sage --jupyter kernelspec list`
and rename to `sagemath-9.0` or `sagemath-8.9` as you wish.

Hope this helps.  Kind regards,  --Samuel

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/046d7b9e-7118-4c5f-bae0-6f71c5589b26%40googlegroups.com.


Re: [sage-support] How to import sagemath into repl.it

2020-05-07 Thread Dima Pasechnik
you basically need to extend repl.it's python with the corresponding
extensions. Do you know if repl.it allow you to install extra modules using
pip (or in some other way)?
(pip would not be quite enough yet, as sagemath needs more than this)


On Thu, 7 May 2020, 20:16 Madison Adams,  wrote:

> Hi,
>
> So I'm having trouble using sage on repl.it.
> Anyone know the procedure to import the packages and such?
> I know my path has to be set to the sage_root but I'm not sure if I did it
> correctly (capture.png)
>
> Anyone have any suggestions on how to navigate it in repl.it?
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/63f0522b-1046-46f0-bfef-8f67c991dcfd%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq2DqRG-p3QNbMJKLFGuNLmk%2B1XokWt%2ByXctLhm6ddee5A%40mail.gmail.com.


[sage-support] How to import sagemath into repl.it

2020-05-07 Thread Madison Adams
Hi,

So I'm having trouble using sage on repl.it.
Anyone know the procedure to import the packages and such?
I know my path has to be set to the sage_root but I'm not sure if I did it 
correctly (capture.png)

Anyone have any suggestions on how to navigate it in repl.it?







-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/63f0522b-1046-46f0-bfef-8f67c991dcfd%40googlegroups.com.


Re: [sage-support] Sagemath saving results

2020-05-07 Thread Dima Pasechnik
On Thu, May 7, 2020 at 11:38 AM Vincent Delecroix
<20100.delecr...@gmail.com> wrote:
>
> Le 06/05/2020 à 00:10, Mauro Weber a écrit :
> > for G in I:
> >
> > if G.is_tree():
>
> If you want to iterate over trees don't filter them by generating all
> graphs. This is a huge waste of time
>
>   # graphs(n) "=" 2^(n^2) / n!
>   # trees(n) "=" Catalan(n)
>
> Trees are easy to generate up to isomorphism.

specifically, see
http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/trees.html

>
> Vincent
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/f2feda5e-4f55-6c05-1d55-9ba66d480f6f%40gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq05KhuZNeLG2s4orut4Ly9zPjvkAdExPJHqws9L1%2B5EWQ%40mail.gmail.com.


Re: [sage-support] Error running the postinst script for pplpy-0.8.4

2020-05-07 Thread Carlos Rodriguez
Hi Vincent,
Just when I posted this I realized that it was the SAME $o
as before!!... everything works just fine now
I wiped out MacOS completely and put Ubuntu on my
iMac and it flies!...


On Thu, May 7, 2020 at 1:08 AM Vincent Delecroix <20100.delecr...@gmail.com>
wrote:

> https://groups.google.com/forum/#!topic/sage-support/UP9siQO00vs
>
> Le 06/05/2020 à 17:34, Carlos Rodriguez a écrit :
> > Ubuntu 20.4
> > on imac late 2013.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/3a2666c9-03f7-89df-6cda-24568cafe31a%40gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CANkXF2VBY52Qd%3DFJNoNvQXRJuYO0UKGB5R9y-Q9KhNFfhrRJPA%40mail.gmail.com.


Re: [sage-support] Sagemath saving results

2020-05-07 Thread Vincent Delecroix

Le 06/05/2020 à 00:10, Mauro Weber a écrit :

for G in I:

if G.is_tree():


If you want to iterate over trees don't filter them by generating all
graphs. This is a huge waste of time

 # graphs(n) "=" 2^(n^2) / n!
 # trees(n) "=" Catalan(n)

Trees are easy to generate up to isomorphism.

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/f2feda5e-4f55-6c05-1d55-9ba66d480f6f%40gmail.com.


Re: [sage-support] How to use notebook in sage 9.0?

2020-05-07 Thread Dima Pasechnik
On Thu, May 7, 2020 at 11:29 AM Szabolcs Horvát  wrote:
>
>
> On Thu, 7 May 2020 at 00:41, John H Palmieri  wrote:
>>
>> Silly question,
>
>
> Any suggestion is always appreciated :-)
>
>>
>> but are you sure you are starting up Sage 9.0 when you do all of this ("sage 
>> --notebook" or "sage --sh")? If you give an explicit path to the Sage 9.0 
>> version, does that help? Do you have any Sage-related environment variables 
>> which could be interfering with things?
>
>
> I start Sage with the full path. I have it in ~/sage-9.0. I'm on macOS and I 
> compiled it from source. I start it as ./sage. I think it's somehow picking 
> up the global jupyter configuration, even if it is running its own jupyter ...

It might be an interference with a "global" jupyter install, if you
have any (e.g. from Conda).

I'd also check that there is nothing funny in ~/.jupyter/, in ~/.sage/ etc.
(you could temporarily rename these to something else, and try running again)


>
>>
>>
>>
>> On Wednesday, May 6, 2020 at 12:54:16 PM UTC-7, Szabolcs Horvát wrote:
>>>
>>> Thanks for the help Dima, but sadly, even this did not work :-( Is there a 
>>> simple way to set up the kernel manually?
>>>
>>> On Wed, 6 May 2020 at 20:32, Dima Pasechnik  wrote:

 this looks like a conflict between two versions of Sage (more
 precisely, of jupyter).

 Not sure how this can happen, though. You migh try to start "sage -sh"
 of your Sage 9.0 and at its
 prompt start

 jupyter-notebook

 it should give you an option to open URL of the shape
 http://localhost:/?token=

 where you should ge the correct jupyter kernel (hopefully)


 On Wed, May 6, 2020 at 7:19 PM Szabolcs Horvát  wrote:
 >
 >
 >
 > On Wednesday, 6 May 2020 20:11:50 UTC+2, Dima Pasechnik wrote:
 >>
 >> On Wed, May 6, 2020 at 6:58 PM Szabolcs Horvát  
 >> wrote:
 >> >
 >> > I use sage 9.0 and sage 8.9 on macOS. I compiled them myself so I 
 >> > would gain access to other ILP solvers than GLPK.
 >> >
 >> > They work fine in command line mode. But if I start Sage 9.0 as sage 
 >> > --notebook, it gives me an interface to create a new notebook, which 
 >> > only has the kernel "Sage 8.9".  How can I get the Sage 9.0 kernel?
 >>
 >>  sage -notebook=jupyter
 >>
 >> should give you jupyter notebook.
 >>
 >> sagenb would only work with Python2 Sage (by default Sage 9.0 is built
 >> with Python3, not 2)
 >>
 >
 > Yes, I do get a Jupyter page in the browser, but not a notebook. In 
 > order to create a notebook, one must click "New" and choose the Jupyter 
 > kernel to use. There is no Sage 9.0 kernel there. There are some of the 
 > Python kernels I use independently of Sage, and there is Sage 8.9. How 
 > can I install the Sage 9.0 kernel? Is there documentation on this?
 >
 > --
 > You received this message because you are subscribed to the Google 
 > Groups "sage-support" group.
 > To unsubscribe from this group and stop receiving emails from it, send 
 > an email to sage-s...@googlegroups.com.
 > To view this discussion on the web visit 
 > https://groups.google.com/d/msgid/sage-support/4feab8f6-c3dc-450d-92c3-95039aa1d7e2%40googlegroups.com.

 --
 You received this message because you are subscribed to a topic in the 
 Google Groups "sage-support" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/sage-support/X5sXp3a-TmA/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 sage-s...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/sage-support/CAAWYfq1viv3gEHKxfPCRqLBmvFc9gOsCKJiu1c_s_yQoDF8XWg%40mail.gmail.com.
>>
>> --
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "sage-support" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/sage-support/X5sXp3a-TmA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> sage-support+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/124d3fe3-1b3a-4c5e-aee5-f2a44bb446cd%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/CAJDnrnrpjMwAYk%3DpPa0rQ7uuU00i-tNtG%3DYWMgEsADbKMd5a6g%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: [sage-support] How to use notebook in sage 9.0?

2020-05-07 Thread Szabolcs Horvát
On Thu, 7 May 2020 at 00:41, John H Palmieri  wrote:

> Silly question,
>

Any suggestion is always appreciated :-)


> but are you sure you are starting up Sage 9.0 when you do all of this
> ("sage --notebook" or "sage --sh")? If you give an explicit path to the
> Sage 9.0 version, does that help? Do you have any Sage-related environment
> variables which could be interfering with things?
>

I start Sage with the full path. I have it in ~/sage-9.0. I'm on macOS and
I compiled it from source. I start it as ./sage. I think it's somehow
picking up the global jupyter configuration, even if it is running its own
jupyter ...


>
>
> On Wednesday, May 6, 2020 at 12:54:16 PM UTC-7, Szabolcs Horvát wrote:
>>
>> Thanks for the help Dima, but sadly, even this did not work :-( Is there
>> a simple way to set up the kernel manually?
>>
>> On Wed, 6 May 2020 at 20:32, Dima Pasechnik  wrote:
>>
>>> this looks like a conflict between two versions of Sage (more
>>> precisely, of jupyter).
>>>
>>> Not sure how this can happen, though. You migh try to start "sage -sh"
>>> of your Sage 9.0 and at its
>>> prompt start
>>>
>>> jupyter-notebook
>>>
>>> it should give you an option to open URL of the shape
>>> http://localhost:/?token=
>>>
>>> where you should ge the correct jupyter kernel (hopefully)
>>>
>>>
>>> On Wed, May 6, 2020 at 7:19 PM Szabolcs Horvát 
>>> wrote:
>>> >
>>> >
>>> >
>>> > On Wednesday, 6 May 2020 20:11:50 UTC+2, Dima Pasechnik wrote:
>>> >>
>>> >> On Wed, May 6, 2020 at 6:58 PM Szabolcs Horvát 
>>> wrote:
>>> >> >
>>> >> > I use sage 9.0 and sage 8.9 on macOS. I compiled them myself so I
>>> would gain access to other ILP solvers than GLPK.
>>> >> >
>>> >> > They work fine in command line mode. But if I start Sage 9.0 as
>>> sage --notebook, it gives me an interface to create a new notebook, which
>>> only has the kernel "Sage 8.9".  How can I get the Sage 9.0 kernel?
>>> >>
>>> >>  sage -notebook=jupyter
>>> >>
>>> >> should give you jupyter notebook.
>>> >>
>>> >> sagenb would only work with Python2 Sage (by default Sage 9.0 is built
>>> >> with Python3, not 2)
>>> >>
>>> >
>>> > Yes, I do get a Jupyter page in the browser, but not a notebook. In
>>> order to create a notebook, one must click "New" and choose the Jupyter
>>> kernel to use. There is no Sage 9.0 kernel there. There are some of the
>>> Python kernels I use independently of Sage, and there is Sage 8.9. How can
>>> I install the Sage 9.0 kernel? Is there documentation on this?
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "sage-support" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an email to sage-s...@googlegroups.com.
>>> > To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/sage-support/4feab8f6-c3dc-450d-92c3-95039aa1d7e2%40googlegroups.com
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "sage-support" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/sage-support/X5sXp3a-TmA/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> sage-s...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/sage-support/CAAWYfq1viv3gEHKxfPCRqLBmvFc9gOsCKJiu1c_s_yQoDF8XWg%40mail.gmail.com
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-support/X5sXp3a-TmA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/124d3fe3-1b3a-4c5e-aee5-f2a44bb446cd%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAJDnrnrpjMwAYk%3DpPa0rQ7uuU00i-tNtG%3DYWMgEsADbKMd5a6g%40mail.gmail.com.