[sage-support] Firefox not launching jupyter session properly

2022-03-28 Thread brett stevens
I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet.  I installed 
SageMath on my computer by cloning the git repository. I compiled sage 
using directions in README.md. The most recent version I compiled was 
SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.  

When I run ```sage -n jupyter file.ipynb```  A new tab opens in firefox 
with address ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports 

> File not found
> 
> Firefox can’t find the file at
> /tmp/tmp9csp8qpp.html.
> 
> Check the file name for capitalization or other typing errors.
> Check to see if the file was moved, renamed or deleted.

However the file does exist.  ```ls -l /tmp/tmp9csp8qpp.html``` returns 

> -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html

If I open the file in Firefox directly using ```Open File...``` from the 
File menu everything works fine.


When I run ```sage -n jupyter file.ipynb``` I get some other links in the 
terminal to use for opening the jupyter session in my browser:

> To access the notebook, open this file in a browser:
> 
file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> Or copy and paste one of these URLs:
> 
http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>  or 
http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878

If I open the first of these, Firefox reports

> Access to the file was denied
> 
> The file at
> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> is not readable.
> 
> It may have been removed, moved, or file permissions may be 
preventing access.

However I have both read and write privileges for this file: ```ls -l 
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
returns

> -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html

I tried changing the privileges to include ```x``` but Firefox still will 
not open it.

Like above if I open the file in Firefox using ```Open File...``` from the 
File menu everything works fine.

-- 
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/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%40googlegroups.com.


Re: [sage-support] Firefox not launching jupyter session properly

2022-03-28 Thread Dima Pasechnik
On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:
>
> I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet.  I installed 
> SageMath on my computer by cloning the git repository. I compiled sage using 
> directions in README.md. The most recent version I compiled was SageMath 9.4. 
> I use Firefox 98.0.2 (64-bit) as my browser.
>
> When I run ```sage -n jupyter file.ipynb```

Such a way of opening a particular notebook is not supported, at least it
does not seem to be documented (in sage -n --help).

Needless so say, "sage -n" opens a page with the current directory
listed, and you can
then click on a particular notebook to open.



>  A new tab opens in firefox with address ```file:///tmp/tmp9csp8qpp.html``` 
> but Firefox reports
>
> > File not found
> >
> > Firefox can’t find the file at
> > /tmp/tmp9csp8qpp.html.
> >
> > Check the file name for capitalization or other typing errors.
> > Check to see if the file was moved, renamed or deleted.
>
> However the file does exist.  ```ls -l /tmp/tmp9csp8qpp.html``` returns
>
> > -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
>
> If I open the file in Firefox directly using ```Open File...``` from the File 
> menu everything works fine.
>
>
> When I run ```sage -n jupyter file.ipynb``` I get some other links in the 
> terminal to use for opening the jupyter session in my browser:
>
> > To access the notebook, open this file in a browser:
> > 
> > file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> > Or copy and paste one of these URLs:
> > 
> > http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
> >  or 
> > http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>
> If I open the first of these, Firefox reports
>
> > Access to the file was denied
> >
> > The file at
> > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> > is not readable.
> >
> > It may have been removed, moved, or file permissions may be preventing 
> > access.
>
> However I have both read and write privileges for this file: ```ls -l 
> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` returns
>
> > -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
> > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>
> I tried changing the privileges to include ```x``` but Firefox still will not 
> open it.
>
> Like above if I open the file in Firefox using ```Open File...``` from the 
> File menu everything works fine.
>
> --
> 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/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%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/CAAWYfq2T7g80RcHNuT8h4-aVakDi%3DUxBU2XO3GH1p9ccB1-DSQ%40mail.gmail.com.


Re: [sage-support] Firefox not launching jupyter session properly

2022-03-28 Thread Henri Girard

https://github.com/jupyter/notebook/issues/1979

Maybe this issue ?

Le 28/03/2022 à 15:41, Dima Pasechnik a écrit :

On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:

I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet.  I installed SageMath 
on my computer by cloning the git repository. I compiled sage using directions 
in README.md. The most recent version I compiled was SageMath 9.4. I use 
Firefox 98.0.2 (64-bit) as my browser.

When I run ```sage -n jupyter file.ipynb```

Such a way of opening a particular notebook is not supported, at least it
does not seem to be documented (in sage -n --help).

Needless so say, "sage -n" opens a page with the current directory
listed, and you can
then click on a particular notebook to open.




  A new tab opens in firefox with address ```file:///tmp/tmp9csp8qpp.html``` 
but Firefox reports


File not found

Firefox can’t find the file at
/tmp/tmp9csp8qpp.html.

 Check the file name for capitalization or other typing errors.
 Check to see if the file was moved, renamed or deleted.

However the file does exist.  ```ls -l /tmp/tmp9csp8qpp.html``` returns


-rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html

If I open the file in Firefox directly using ```Open File...``` from the File 
menu everything works fine.


When I run ```sage -n jupyter file.ipynb``` I get some other links in the 
terminal to use for opening the jupyter session in my browser:


 To access the notebook, open this file in a browser:
 
file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
 Or copy and paste one of these URLs:
 
http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
  or 
http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878

If I open the first of these, Firefox reports


Access to the file was denied

The file at
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
is not readable.

 It may have been removed, moved, or file permissions may be preventing 
access.

However I have both read and write privileges for this file: ```ls -l 
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` returns


-rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html

I tried changing the privileges to include ```x``` but Firefox still will not 
open it.

Like above if I open the file in Firefox using ```Open File...``` from the File 
menu everything works fine.

--
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/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%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/1454b01d-2c56-3d2c-94b0-92e4f230c689%40gmail.com.


Re: [sage-support] Firefox not launching jupyter session properly

2022-03-28 Thread Dima Pasechnik
On Mon, Mar 28, 2022 at 4:22 PM Henri Girard  wrote:
>
> https://github.com/jupyter/notebook/issues/1979
>
> Maybe this issue ?

no, that is about jupyter notebook server.

Here, the issue is how to bypass the intermediate step of launching
a notebook server, and open a particular notebook directly.
In some environment this can be done by just clicking on a notebook
file in a file browser.
E.g. this can be used to run notebooks in VSCode (see
https://trac.sagemath.org/ticket/30484)



>
> Le 28/03/2022 à 15:41, Dima Pasechnik a écrit :
> > On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:
> >> I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet.  I installed 
> >> SageMath on my computer by cloning the git repository. I compiled sage 
> >> using directions in README.md. The most recent version I compiled was 
> >> SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.
> >>
> >> When I run ```sage -n jupyter file.ipynb```
> > Such a way of opening a particular notebook is not supported, at least it
> > does not seem to be documented (in sage -n --help).
> >
> > Needless so say, "sage -n" opens a page with the current directory
> > listed, and you can
> > then click on a particular notebook to open.
> >
> >
> >
> >>   A new tab opens in firefox with address 
> >> ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports
> >>
> >>> File not found
> >>>
> >>> Firefox can’t find the file at
> >>> /tmp/tmp9csp8qpp.html.
> >>>
> >>>  Check the file name for capitalization or other typing errors.
> >>>  Check to see if the file was moved, renamed or deleted.
> >> However the file does exist.  ```ls -l /tmp/tmp9csp8qpp.html``` returns
> >>
> >>> -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
> >> If I open the file in Firefox directly using ```Open File...``` from the 
> >> File menu everything works fine.
> >>
> >>
> >> When I run ```sage -n jupyter file.ipynb``` I get some other links in the 
> >> terminal to use for opening the jupyter session in my browser:
> >>
> >>>  To access the notebook, open this file in a browser:
> >>>  
> >>> file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> >>>  Or copy and paste one of these URLs:
> >>>  
> >>> http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
> >>>   or 
> >>> http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
> >> If I open the first of these, Firefox reports
> >>
> >>> Access to the file was denied
> >>>
> >>> The file at
> >>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> >>> is not readable.
> >>>
> >>>  It may have been removed, moved, or file permissions may be 
> >>> preventing access.
> >> However I have both read and write privileges for this file: ```ls -l 
> >> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
> >> returns
> >>
> >>> -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
> >>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> >> I tried changing the privileges to include ```x``` but Firefox still will 
> >> not open it.
> >>
> >> Like above if I open the file in Firefox using ```Open File...``` from the 
> >> File menu everything works fine.
> >>
> >> --
> >> 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/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%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/1454b01d-2c56-3d2c-94b0-92e4f230c689%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/CAAWYfq3TzmOrLtzNqB49RiqVuLX4cK-5Ee7%2BkB3w%2B3rQGhEeVQ%40mail.gmail.com.


Re: [sage-support] Firefox not launching jupyter session properly

2022-03-28 Thread brett stevens
It is not the password issue that HG suggested.  Nor is it an issue with 
specifically trying to open a file rather than have a directory open in 
jupyter.  The issue is that Firefox claims to not be able to read the file 
that it is passed.  But the file exists with suitable permissions and if I 
use ```Open File...```  Firefox **can** access/read the file.  It used to 
be that when I ran ```sage -n``` or ```sage -n jupyter file.ipynb``` either 
the directory or the specific file, respectively, would successfully appear 
in the tab that opens in Firefox, but now I am getting the 
> file not found
error.

On Monday, March 28, 2022 at 12:29:46 PM UTC-4 dim...@gmail.com wrote:

> On Mon, Mar 28, 2022 at 4:22 PM Henri Girard  wrote:
> >
> > https://github.com/jupyter/notebook/issues/1979
> >
> > Maybe this issue ?
>
> no, that is about jupyter notebook server.
>
> Here, the issue is how to bypass the intermediate step of launching
> a notebook server, and open a particular notebook directly.
> In some environment this can be done by just clicking on a notebook
> file in a file browser.
> E.g. this can be used to run notebooks in VSCode (see
> https://trac.sagemath.org/ticket/30484)
>
>
>
> >
> > Le 28/03/2022 à 15:41, Dima Pasechnik a écrit :
> > > On Mon, Mar 28, 2022 at 2:18 PM brett stevens  
> wrote:
> > >> I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I installed 
> SageMath on my computer by cloning the git repository. I compiled sage 
> using directions in README.md. The most recent version I compiled was 
> SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.
> > >>
> > >> When I run ```sage -n jupyter file.ipynb```
> > > Such a way of opening a particular notebook is not supported, at least 
> it
> > > does not seem to be documented (in sage -n --help).
> > >
> > > Needless so say, "sage -n" opens a page with the current directory
> > > listed, and you can
> > > then click on a particular notebook to open.
> > >
> > >
> > >
> > >> A new tab opens in firefox with address 
> ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports
> > >>
> > >>> File not found
> > >>>
> > >>> Firefox can’t find the file at
> > >>> /tmp/tmp9csp8qpp.html.
> > >>>
> > >>> Check the file name for capitalization or other typing errors.
> > >>> Check to see if the file was moved, renamed or deleted.
> > >> However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` returns
> > >>
> > >>> -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
> > >> If I open the file in Firefox directly using ```Open File...``` from 
> the File menu everything works fine.
> > >>
> > >>
> > >> When I run ```sage -n jupyter file.ipynb``` I get some other links in 
> the terminal to use for opening the jupyter session in my browser:
> > >>
> > >>> To access the notebook, open this file in a browser:
> > >>> 
> file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> > >>> Or copy and paste one of these URLs:
> > >>> 
> http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
> > >>> or 
> http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
> > >> If I open the first of these, Firefox reports
> > >>
> > >>> Access to the file was denied
> > >>>
> > >>> The file at
> > >>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> > >>> is not readable.
> > >>>
> > >>> It may have been removed, moved, or file permissions may be 
> preventing access.
> > >> However I have both read and write privileges for this file: ```ls -l 
> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
> returns
> > >>
> > >>> -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> > >> I tried changing the privileges to include ```x``` but Firefox still 
> will not open it.
> > >>
> > >> Like above if I open the file in Firefox using ```Open File...``` 
> from the File menu everything works fine.
> > >>
> > >> --
> > >> 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...@googlegroups.com.
> > >> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%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...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/1454b01d-2c56-3d2c-94b0-92e4f230c689%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...@googlegroup

Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread Dima Pasechnik
On Tue, Mar 29, 2022 at 6:15 AM brett stevens  wrote:
>
> It is not the password issue that HG suggested.  Nor is it an issue with 
> specifically trying to open a file rather than have a directory open in 
> jupyter.  The issue is that Firefox claims to not be able to read the file 
> that it is passed.  But the file exists with suitable permissions and if I 
> use ```Open File...```  Firefox **can** access/read the file.  It used to be 
> that when I ran ```sage -n``` or ```sage -n jupyter file.ipynb``` either the 
> directory or the specific file, respectively, would successfully appear in 
> the tab that opens in Firefox, but now I am getting the
> > file not found
> error.

it's an issue with your Firefox setup (or a new feature), not a
general Firefox/Sage feature/bug.

E.g. on Gentoo with its Firefox (97.0.1) I can do

./sage -n jupyter ../sage-clang/u1.ipynb

and u1 gets opened, although I see a warning:

[W 08:45:52.113 NotebookApp] Notebook u1.ipynb is not trusted

I can remove this warning by running in Sage's shell (i.e. at ./sage -sh prompt)

jupyter trust  u1.ipynb


By the way, I can see the same kind of error as you describe on
ChromeOS (running Sage in a VM)
There "./sage -n jupyter" works, and opens the directory in Chrome browser,
but "./sage -n jupyter u1.ipynb" errors out with "permission denied"

Apparently some kind of sandboxing goes on here.

You might try that "jupyter trust " as above, and see if it helps.
Also, I'd try installing jupyterlab

make jupyterlab

which is actually more up to date than the classic (and deprecated by
upstream) Jupyter notebook,
and see if the error goes away.




>
> On Monday, March 28, 2022 at 12:29:46 PM UTC-4 dim...@gmail.com wrote:
>>
>> On Mon, Mar 28, 2022 at 4:22 PM Henri Girard  wrote:
>> >
>> > https://github.com/jupyter/notebook/issues/1979
>> >
>> > Maybe this issue ?
>>
>> no, that is about jupyter notebook server.
>>
>> Here, the issue is how to bypass the intermediate step of launching
>> a notebook server, and open a particular notebook directly.
>> In some environment this can be done by just clicking on a notebook
>> file in a file browser.
>> E.g. this can be used to run notebooks in VSCode (see
>> https://trac.sagemath.org/ticket/30484)
>>
>>
>>
>> >
>> > Le 28/03/2022 à 15:41, Dima Pasechnik a écrit :
>> > > On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:
>> > >> I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I installed 
>> > >> SageMath on my computer by cloning the git repository. I compiled sage 
>> > >> using directions in README.md. The most recent version I compiled was 
>> > >> SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.
>> > >>
>> > >> When I run ```sage -n jupyter file.ipynb```
>> > > Such a way of opening a particular notebook is not supported, at least it
>> > > does not seem to be documented (in sage -n --help).
>> > >
>> > > Needless so say, "sage -n" opens a page with the current directory
>> > > listed, and you can
>> > > then click on a particular notebook to open.
>> > >
>> > >
>> > >
>> > >> A new tab opens in firefox with address 
>> > >> ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports
>> > >>
>> > >>> File not found
>> > >>>
>> > >>> Firefox can’t find the file at
>> > >>> /tmp/tmp9csp8qpp.html.
>> > >>>
>> > >>> Check the file name for capitalization or other typing errors.
>> > >>> Check to see if the file was moved, renamed or deleted.
>> > >> However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` returns
>> > >>
>> > >>> -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
>> > >> If I open the file in Firefox directly using ```Open File...``` from 
>> > >> the File menu everything works fine.
>> > >>
>> > >>
>> > >> When I run ```sage -n jupyter file.ipynb``` I get some other links in 
>> > >> the terminal to use for opening the jupyter session in my browser:
>> > >>
>> > >>> To access the notebook, open this file in a browser:
>> > >>> file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>> > >>> Or copy and paste one of these URLs:
>> > >>> http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>> > >>> or 
>> > >>> http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>> > >> If I open the first of these, Firefox reports
>> > >>
>> > >>> Access to the file was denied
>> > >>>
>> > >>> The file at
>> > >>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>> > >>> is not readable.
>> > >>>
>> > >>> It may have been removed, moved, or file permissions may be preventing 
>> > >>> access.
>> > >> However I have both read and write privileges for this file: ```ls -l 
>> > >> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
>> > >> returns
>> > >>
>> > >>> -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
>> > >>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>> > >> I tried changing the privileges to include ```x``` but Firefox still 
>>

Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread Dima Pasechnik
On Tue, Mar 29, 2022 at 6:12 AM brett stevens  wrote:
>
> When I run ```sage -n``` the same thing happens:  The page that opens in 
> Firefox says
> > Access to the file was denied
> > The file at 
> > /home/brett/.local/share/jupyter/runtime/nbserver-35966-open.html is not 
> > readable.
> > It may have been removed, moved, or file permissions may be preventing 
> > access.

Does system-wide jupyter (apt-get install jupyter) package work for
your Firefox?
If it doesn't, then the problem has little to do with Sage.
(and probably you'd need to fiddle with your Firefox security settings)

If it does, you can use it to run Sage notebooks
- you'd need to run, in Sage'd top directory,

 jupyter kernelspec install
local/var/lib/sage/venv-python3.9/share/jupyter/kernels/sagemath

(assuming you have python3.9 (else you'd need to adjust the path accordingly)




>
>
> On Monday, March 28, 2022 at 9:41:34 AM UTC-4 dim...@gmail.com wrote:
>>
>> On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:
>> >
>> > I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I installed 
>> > SageMath on my computer by cloning the git repository. I compiled sage 
>> > using directions in README.md. The most recent version I compiled was 
>> > SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.
>> >
>> > When I run ```sage -n jupyter file.ipynb```
>>
>> Such a way of opening a particular notebook is not supported, at least it
>> does not seem to be documented (in sage -n --help).
>>
>> Needless so say, "sage -n" opens a page with the current directory
>> listed, and you can
>> then click on a particular notebook to open.
>>
>>
>>
>> > A new tab opens in firefox with address ```file:///tmp/tmp9csp8qpp.html``` 
>> > but Firefox reports
>> >
>> > > File not found
>> > >
>> > > Firefox can’t find the file at
>> > > /tmp/tmp9csp8qpp.html.
>> > >
>> > > Check the file name for capitalization or other typing errors.
>> > > Check to see if the file was moved, renamed or deleted.
>> >
>> > However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` returns
>> >
>> > > -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
>> >
>> > If I open the file in Firefox directly using ```Open File...``` from the 
>> > File menu everything works fine.
>> >
>> >
>> > When I run ```sage -n jupyter file.ipynb``` I get some other links in the 
>> > terminal to use for opening the jupyter session in my browser:
>> >
>> > > To access the notebook, open this file in a browser:
>> > > file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>> > > Or copy and paste one of these URLs:
>> > > http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>> > > or 
>> > > http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>> >
>> > If I open the first of these, Firefox reports
>> >
>> > > Access to the file was denied
>> > >
>> > > The file at
>> > > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>> > > is not readable.
>> > >
>> > > It may have been removed, moved, or file permissions may be preventing 
>> > > access.
>> >
>> > However I have both read and write privileges for this file: ```ls -l 
>> > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
>> > returns
>> >
>> > > -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
>> > > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>> >
>> > I tried changing the privileges to include ```x``` but Firefox still will 
>> > not open it.
>> >
>> > Like above if I open the file in Firefox using ```Open File...``` from the 
>> > File menu everything works fine.
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/sage-support/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%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/3a0eecf5-c605-473b-be5a-836272cce244n%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/CAAWYfq2fx6GBS6NXrrVy%2B84D5HLqYT6T%2B157oecrh3dh_5RjAA%40mail.gmail.com.


Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread brett stevens
I spoke to soon. :-)  My solution makes the Ubuntu Jupyter work OK  but  
```sage -n``` does not work.  For SageMath's jupyter I needed to make the 
same change in ```$SAGE_ROOT/local/etc/jupyter/jupyter_notebook_config.py```


On Tuesday, March 29, 2022 at 11:02:52 AM UTC-4 brett stevens wrote:

> @dim  I installed Ubuntu's jupyter and I am getting the same problem there 
> so I agree this is not a SageMath problem.  I will post my question to an 
> appropriate forum.  If I find a solution, I will report the fix here.
> @HG, I tried setting ```c.NotebookApp.open_browser = True`` but it did 
> not fix the problem.  But thank you for the reference to that thread as it 
> still may be related.
> On Tuesday, March 29, 2022 at 8:25:35 AM UTC-4 dim...@gmail.com wrote:
>
>> On Tue, Mar 29, 2022 at 6:12 AM brett stevens  wrote: 
>> > 
>> > When I run ```sage -n``` the same thing happens: The page that opens in 
>> Firefox says 
>> > > Access to the file was denied 
>> > > The file at 
>> /home/brett/.local/share/jupyter/runtime/nbserver-35966-open.html is not 
>> readable. 
>> > > It may have been removed, moved, or file permissions may be 
>> preventing access. 
>>
>> Does system-wide jupyter (apt-get install jupyter) package work for 
>> your Firefox? 
>> If it doesn't, then the problem has little to do with Sage. 
>> (and probably you'd need to fiddle with your Firefox security settings) 
>>
>> If it does, you can use it to run Sage notebooks 
>> - you'd need to run, in Sage'd top directory, 
>>
>> jupyter kernelspec install 
>> local/var/lib/sage/venv-python3.9/share/jupyter/kernels/sagemath 
>>
>> (assuming you have python3.9 (else you'd need to adjust the path 
>> accordingly) 
>>
>>
>>
>>
>> > 
>> > 
>> > On Monday, March 28, 2022 at 9:41:34 AM UTC-4 dim...@gmail.com wrote: 
>> >> 
>> >> On Mon, Mar 28, 2022 at 2:18 PM brett stevens  
>> wrote: 
>> >> > 
>> >> > I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I 
>> installed SageMath on my computer by cloning the git repository. I compiled 
>> sage using directions in README.md. The most recent version I compiled was 
>> SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser. 
>> >> > 
>> >> > When I run ```sage -n jupyter file.ipynb``` 
>> >> 
>> >> Such a way of opening a particular notebook is not supported, at least 
>> it 
>> >> does not seem to be documented (in sage -n --help). 
>> >> 
>> >> Needless so say, "sage -n" opens a page with the current directory 
>> >> listed, and you can 
>> >> then click on a particular notebook to open. 
>> >> 
>> >> 
>> >> 
>> >> > A new tab opens in firefox with address 
>> ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports 
>> >> > 
>> >> > > File not found 
>> >> > > 
>> >> > > Firefox can’t find the file at 
>> >> > > /tmp/tmp9csp8qpp.html. 
>> >> > > 
>> >> > > Check the file name for capitalization or other typing errors. 
>> >> > > Check to see if the file was moved, renamed or deleted. 
>> >> > 
>> >> > However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` 
>> returns 
>> >> > 
>> >> > > -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html 
>> >> > 
>> >> > If I open the file in Firefox directly using ```Open File...``` from 
>> the File menu everything works fine. 
>> >> > 
>> >> > 
>> >> > When I run ```sage -n jupyter file.ipynb``` I get some other links 
>> in the terminal to use for opening the jupyter session in my browser: 
>> >> > 
>> >> > > To access the notebook, open this file in a browser: 
>> >> > > 
>> file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html 
>> >> > > Or copy and paste one of these URLs: 
>> >> > > 
>> http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878 
>> >> > > or 
>> http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>>  
>> >> > 
>> >> > If I open the first of these, Firefox reports 
>> >> > 
>> >> > > Access to the file was denied 
>> >> > > 
>> >> > > The file at 
>> >> > > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html 
>> >> > > is not readable. 
>> >> > > 
>> >> > > It may have been removed, moved, or file permissions may be 
>> preventing access. 
>> >> > 
>> >> > However I have both read and write privileges for this file: ```ls 
>> -l /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
>> returns 
>> >> > 
>> >> > > -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html 
>> >> > 
>> >> > I tried changing the privileges to include ```x``` but Firefox still 
>> will not open it. 
>> >> > 
>> >> > Like above if I open the file in Firefox using ```Open File...``` 
>> from the File menu everything works fine. 
>> >> > 
>> >> > -- 
>> >> > 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...@googlegroups.com. 
>> >> > T

Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread brett stevens
The problem seems to be that The Ubuntu Firefox is now installed with a 
snap which is not given access to dotted files in the user file space and 
jupyter's redirect file is in ~/.local/  The solution from Stackexchange As 
Ubuntu 

 
is to place the line 
> c.NotebookApp.use_redirect_file = False
in the file ```~/.jupyter/jupyter_notebook_config.py```

Thank you all for your help and time.
brett


On Tuesday, March 29, 2022 at 11:02:52 AM UTC-4 brett stevens wrote:

> @dim  I installed Ubuntu's jupyter and I am getting the same problem there 
> so I agree this is not a SageMath problem.  I will post my question to an 
> appropriate forum.  If I find a solution, I will report the fix here.
> @HG, I tried setting ```c.NotebookApp.open_browser = True`` but it did 
> not fix the problem.  But thank you for the reference to that thread as it 
> still may be related.
> On Tuesday, March 29, 2022 at 8:25:35 AM UTC-4 dim...@gmail.com wrote:
>
>> On Tue, Mar 29, 2022 at 6:12 AM brett stevens  wrote: 
>> > 
>> > When I run ```sage -n``` the same thing happens: The page that opens in 
>> Firefox says 
>> > > Access to the file was denied 
>> > > The file at 
>> /home/brett/.local/share/jupyter/runtime/nbserver-35966-open.html is not 
>> readable. 
>> > > It may have been removed, moved, or file permissions may be 
>> preventing access. 
>>
>> Does system-wide jupyter (apt-get install jupyter) package work for 
>> your Firefox? 
>> If it doesn't, then the problem has little to do with Sage. 
>> (and probably you'd need to fiddle with your Firefox security settings) 
>>
>> If it does, you can use it to run Sage notebooks 
>> - you'd need to run, in Sage'd top directory, 
>>
>> jupyter kernelspec install 
>> local/var/lib/sage/venv-python3.9/share/jupyter/kernels/sagemath 
>>
>> (assuming you have python3.9 (else you'd need to adjust the path 
>> accordingly) 
>>
>>
>>
>>
>> > 
>> > 
>> > On Monday, March 28, 2022 at 9:41:34 AM UTC-4 dim...@gmail.com wrote: 
>> >> 
>> >> On Mon, Mar 28, 2022 at 2:18 PM brett stevens  
>> wrote: 
>> >> > 
>> >> > I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I 
>> installed SageMath on my computer by cloning the git repository. I compiled 
>> sage using directions in README.md. The most recent version I compiled was 
>> SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser. 
>> >> > 
>> >> > When I run ```sage -n jupyter file.ipynb``` 
>> >> 
>> >> Such a way of opening a particular notebook is not supported, at least 
>> it 
>> >> does not seem to be documented (in sage -n --help). 
>> >> 
>> >> Needless so say, "sage -n" opens a page with the current directory 
>> >> listed, and you can 
>> >> then click on a particular notebook to open. 
>> >> 
>> >> 
>> >> 
>> >> > A new tab opens in firefox with address 
>> ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports 
>> >> > 
>> >> > > File not found 
>> >> > > 
>> >> > > Firefox can’t find the file at 
>> >> > > /tmp/tmp9csp8qpp.html. 
>> >> > > 
>> >> > > Check the file name for capitalization or other typing errors. 
>> >> > > Check to see if the file was moved, renamed or deleted. 
>> >> > 
>> >> > However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` 
>> returns 
>> >> > 
>> >> > > -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html 
>> >> > 
>> >> > If I open the file in Firefox directly using ```Open File...``` from 
>> the File menu everything works fine. 
>> >> > 
>> >> > 
>> >> > When I run ```sage -n jupyter file.ipynb``` I get some other links 
>> in the terminal to use for opening the jupyter session in my browser: 
>> >> > 
>> >> > > To access the notebook, open this file in a browser: 
>> >> > > 
>> file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html 
>> >> > > Or copy and paste one of these URLs: 
>> >> > > 
>> http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878 
>> >> > > or 
>> http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>>  
>> >> > 
>> >> > If I open the first of these, Firefox reports 
>> >> > 
>> >> > > Access to the file was denied 
>> >> > > 
>> >> > > The file at 
>> >> > > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html 
>> >> > > is not readable. 
>> >> > > 
>> >> > > It may have been removed, moved, or file permissions may be 
>> preventing access. 
>> >> > 
>> >> > However I have both read and write privileges for this file: ```ls 
>> -l /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
>> returns 
>> >> > 
>> >> > > -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
>> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html 
>> >> > 
>> >> > I tried changing the privileges to include ```x``` but Firefox still 
>> will not open it. 
>> >> > 
>> >> > Like above if I open the file in Firefox using ```Open File...``` 
>> from the File menu

Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread Dima Pasechnik
I've proposed a fix for this on https://trac.sagemath.org/ticket/33592
(there is no reason to use temp files, IMHO)
so we add c.NotebookApp.use_redirect_file=False to the corresponing config file.

Needs review.


On Tue, Mar 29, 2022 at 4:46 PM brett stevens  wrote:
>
> I spoke to soon. :-)  My solution makes the Ubuntu Jupyter work OK  but  
> ```sage -n``` does not work.  For SageMath's jupyter I needed to make the 
> same change in ```$SAGE_ROOT/local/etc/jupyter/jupyter_notebook_config.py```
>
>
> On Tuesday, March 29, 2022 at 11:02:52 AM UTC-4 brett stevens wrote:
>>
>> @dim  I installed Ubuntu's jupyter and I am getting the same problem there 
>> so I agree this is not a SageMath problem.  I will post my question to an 
>> appropriate forum.  If I find a solution, I will report the fix here.
>> @HG, I tried setting ```c.NotebookApp.open_browser = True`` but it did not 
>> fix the problem.  But thank you for the reference to that thread as it still 
>> may be related.
>> On Tuesday, March 29, 2022 at 8:25:35 AM UTC-4 dim...@gmail.com wrote:
>>>
>>> On Tue, Mar 29, 2022 at 6:12 AM brett stevens  wrote:
>>> >
>>> > When I run ```sage -n``` the same thing happens: The page that opens in 
>>> > Firefox says
>>> > > Access to the file was denied
>>> > > The file at 
>>> > > /home/brett/.local/share/jupyter/runtime/nbserver-35966-open.html is 
>>> > > not readable.
>>> > > It may have been removed, moved, or file permissions may be preventing 
>>> > > access.
>>>
>>> Does system-wide jupyter (apt-get install jupyter) package work for
>>> your Firefox?
>>> If it doesn't, then the problem has little to do with Sage.
>>> (and probably you'd need to fiddle with your Firefox security settings)
>>>
>>> If it does, you can use it to run Sage notebooks
>>> - you'd need to run, in Sage'd top directory,
>>>
>>> jupyter kernelspec install
>>> local/var/lib/sage/venv-python3.9/share/jupyter/kernels/sagemath
>>>
>>> (assuming you have python3.9 (else you'd need to adjust the path 
>>> accordingly)
>>>
>>>
>>>
>>>
>>> >
>>> >
>>> > On Monday, March 28, 2022 at 9:41:34 AM UTC-4 dim...@gmail.com wrote:
>>> >>
>>> >> On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:
>>> >> >
>>> >> > I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I installed 
>>> >> > SageMath on my computer by cloning the git repository. I compiled sage 
>>> >> > using directions in README.md. The most recent version I compiled was 
>>> >> > SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.
>>> >> >
>>> >> > When I run ```sage -n jupyter file.ipynb```
>>> >>
>>> >> Such a way of opening a particular notebook is not supported, at least it
>>> >> does not seem to be documented (in sage -n --help).
>>> >>
>>> >> Needless so say, "sage -n" opens a page with the current directory
>>> >> listed, and you can
>>> >> then click on a particular notebook to open.
>>> >>
>>> >>
>>> >>
>>> >> > A new tab opens in firefox with address 
>>> >> > ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports
>>> >> >
>>> >> > > File not found
>>> >> > >
>>> >> > > Firefox can’t find the file at
>>> >> > > /tmp/tmp9csp8qpp.html.
>>> >> > >
>>> >> > > Check the file name for capitalization or other typing errors.
>>> >> > > Check to see if the file was moved, renamed or deleted.
>>> >> >
>>> >> > However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` returns
>>> >> >
>>> >> > > -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
>>> >> >
>>> >> > If I open the file in Firefox directly using ```Open File...``` from 
>>> >> > the File menu everything works fine.
>>> >> >
>>> >> >
>>> >> > When I run ```sage -n jupyter file.ipynb``` I get some other links in 
>>> >> > the terminal to use for opening the jupyter session in my browser:
>>> >> >
>>> >> > > To access the notebook, open this file in a browser:
>>> >> > > file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>>> >> > > Or copy and paste one of these URLs:
>>> >> > > http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>>> >> > > or 
>>> >> > > http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>>> >> >
>>> >> > If I open the first of these, Firefox reports
>>> >> >
>>> >> > > Access to the file was denied
>>> >> > >
>>> >> > > The file at
>>> >> > > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>>> >> > > is not readable.
>>> >> > >
>>> >> > > It may have been removed, moved, or file permissions may be 
>>> >> > > preventing access.
>>> >> >
>>> >> > However I have both read and write privileges for this file: ```ls -l 
>>> >> > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
>>> >> > returns
>>> >> >
>>> >> > > -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
>>> >> > > /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>>> >> >
>>> >> > I tried changing the privileges to include ```x``` but Firefox still 
>>> >> > will not open it.
>>> >> >
>>> >> > Like abov

Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread Henri Girard

thanks you :)

Le 29/03/2022 à 19:23, Dima Pasechnik a écrit :

I've proposed a fix for this on https://trac.sagemath.org/ticket/33592
(there is no reason to use temp files, IMHO)
so we add c.NotebookApp.use_redirect_file=False to the corresponing config file.

Needs review.


On Tue, Mar 29, 2022 at 4:46 PM brett stevens  wrote:

I spoke to soon. :-)  My solution makes the Ubuntu Jupyter work OK  but  
```sage -n``` does not work.  For SageMath's jupyter I needed to make the same 
change in ```$SAGE_ROOT/local/etc/jupyter/jupyter_notebook_config.py```


On Tuesday, March 29, 2022 at 11:02:52 AM UTC-4 brett stevens wrote:

@dim  I installed Ubuntu's jupyter and I am getting the same problem there so I 
agree this is not a SageMath problem.  I will post my question to an 
appropriate forum.  If I find a solution, I will report the fix here.
@HG, I tried setting ```c.NotebookApp.open_browser = True`` but it did not fix 
the problem.  But thank you for the reference to that thread as it still may be 
related.
On Tuesday, March 29, 2022 at 8:25:35 AM UTC-4 dim...@gmail.com wrote:

On Tue, Mar 29, 2022 at 6:12 AM brett stevens  wrote:

When I run ```sage -n``` the same thing happens: The page that opens in Firefox 
says

Access to the file was denied
The file at /home/brett/.local/share/jupyter/runtime/nbserver-35966-open.html 
is not readable.
It may have been removed, moved, or file permissions may be preventing access.

Does system-wide jupyter (apt-get install jupyter) package work for
your Firefox?
If it doesn't, then the problem has little to do with Sage.
(and probably you'd need to fiddle with your Firefox security settings)

If it does, you can use it to run Sage notebooks
- you'd need to run, in Sage'd top directory,

jupyter kernelspec install
local/var/lib/sage/venv-python3.9/share/jupyter/kernels/sagemath

(assuming you have python3.9 (else you'd need to adjust the path accordingly)






On Monday, March 28, 2022 at 9:41:34 AM UTC-4 dim...@gmail.com wrote:

On Mon, Mar 28, 2022 at 2:18 PM brett stevens  wrote:

I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I installed SageMath 
on my computer by cloning the git repository. I compiled sage using directions 
in README.md. The most recent version I compiled was SageMath 9.4. I use 
Firefox 98.0.2 (64-bit) as my browser.

When I run ```sage -n jupyter file.ipynb```

Such a way of opening a particular notebook is not supported, at least it
does not seem to be documented (in sage -n --help).

Needless so say, "sage -n" opens a page with the current directory
listed, and you can
then click on a particular notebook to open.




A new tab opens in firefox with address ```file:///tmp/tmp9csp8qpp.html``` but 
Firefox reports


File not found

Firefox can’t find the file at
/tmp/tmp9csp8qpp.html.

Check the file name for capitalization or other typing errors.
Check to see if the file was moved, renamed or deleted.

However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` returns


-rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html

If I open the file in Firefox directly using ```Open File...``` from the File 
menu everything works fine.


When I run ```sage -n jupyter file.ipynb``` I get some other links in the 
terminal to use for opening the jupyter session in my browser:


To access the notebook, open this file in a browser:
file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
Or copy and paste one of these URLs:
http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
or http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878

If I open the first of these, Firefox reports


Access to the file was denied

The file at
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
is not readable.

It may have been removed, moved, or file permissions may be preventing access.

However I have both read and write privileges for this file: ```ls -l 
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` returns


-rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
/home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html

I tried changing the privileges to include ```x``` but Firefox still will not 
open it.

Like above if I open the file in Firefox using ```Open File...``` from the File 
menu everything works fine.

--
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/5bd21310-f8d5-48f8-90bd-d2732922d6bcn%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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.

Re: [sage-support] Firefox not launching jupyter session properly

2022-03-29 Thread brett stevens
Thanks!

On Tuesday, March 29, 2022 at 1:56:09 PM UTC-4 HG wrote:

> thanks you :)
>
> Le 29/03/2022 à 19:23, Dima Pasechnik a écrit :
> > I've proposed a fix for this on https://trac.sagemath.org/ticket/33592
> > (there is no reason to use temp files, IMHO)
> > so we add c.NotebookApp.use_redirect_file=False to the corresponing 
> config file.
> >
> > Needs review.
> >
> >
> > On Tue, Mar 29, 2022 at 4:46 PM brett stevens  wrote:
> >> I spoke to soon. :-) My solution makes the Ubuntu Jupyter work OK but 
> ```sage -n``` does not work. For SageMath's jupyter I needed to make the 
> same change in ```$SAGE_ROOT/local/etc/jupyter/jupyter_notebook_config.py```
> >>
> >>
> >> On Tuesday, March 29, 2022 at 11:02:52 AM UTC-4 brett stevens wrote:
> >>> @dim I installed Ubuntu's jupyter and I am getting the same problem 
> there so I agree this is not a SageMath problem. I will post my question to 
> an appropriate forum. If I find a solution, I will report the fix here.
> >>> @HG, I tried setting ```c.NotebookApp.open_browser = True`` but it did 
> not fix the problem. But thank you for the reference to that thread as it 
> still may be related.
> >>> On Tuesday, March 29, 2022 at 8:25:35 AM UTC-4 dim...@gmail.com wrote:
>  On Tue, Mar 29, 2022 at 6:12 AM brett stevens  
> wrote:
> > When I run ```sage -n``` the same thing happens: The page that opens 
> in Firefox says
> >> Access to the file was denied
> >> The file at 
> /home/brett/.local/share/jupyter/runtime/nbserver-35966-open.html is not 
> readable.
> >> It may have been removed, moved, or file permissions may be 
> preventing access.
>  Does system-wide jupyter (apt-get install jupyter) package work for
>  your Firefox?
>  If it doesn't, then the problem has little to do with Sage.
>  (and probably you'd need to fiddle with your Firefox security 
> settings)
> 
>  If it does, you can use it to run Sage notebooks
>  - you'd need to run, in Sage'd top directory,
> 
>  jupyter kernelspec install
>  local/var/lib/sage/venv-python3.9/share/jupyter/kernels/sagemath
> 
>  (assuming you have python3.9 (else you'd need to adjust the path 
> accordingly)
> 
> 
> 
> 
> >
> > On Monday, March 28, 2022 at 9:41:34 AM UTC-4 dim...@gmail.com 
> wrote:
> >> On Mon, Mar 28, 2022 at 2:18 PM brett stevens  
> wrote:
> >>> I am running Ubuntu 21.10 on a Lenovo Thinkpad X1 Tablet. I 
> installed SageMath on my computer by cloning the git repository. I compiled 
> sage using directions in README.md. The most recent version I compiled was 
> SageMath 9.4. I use Firefox 98.0.2 (64-bit) as my browser.
> >>>
> >>> When I run ```sage -n jupyter file.ipynb```
> >> Such a way of opening a particular notebook is not supported, at 
> least it
> >> does not seem to be documented (in sage -n --help).
> >>
> >> Needless so say, "sage -n" opens a page with the current directory
> >> listed, and you can
> >> then click on a particular notebook to open.
> >>
> >>
> >>
> >>> A new tab opens in firefox with address 
> ```file:///tmp/tmp9csp8qpp.html``` but Firefox reports
> >>>
>  File not found
> 
>  Firefox can’t find the file at
>  /tmp/tmp9csp8qpp.html.
> 
>  Check the file name for capitalization or other typing errors.
>  Check to see if the file was moved, renamed or deleted.
> >>> However the file does exist. ```ls -l /tmp/tmp9csp8qpp.html``` 
> returns
> >>>
>  -rw--- 1 brett brett 751 Mar 25 10:15 /tmp/tmp9csp8qpp.html
> >>> If I open the file in Firefox directly using ```Open File...``` 
> from the File menu everything works fine.
> >>>
> >>>
> >>> When I run ```sage -n jupyter file.ipynb``` I get some other links 
> in the terminal to use for opening the jupyter session in my browser:
> >>>
>  To access the notebook, open this file in a browser:
>  
> file:///home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>  Or copy and paste one of these URLs:
>  
> http://hamm:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
>  or 
> http://127.0.0.1:/?token=cb4036e78faba0faa3bd0d50b73cc7a94e302196c474d878
> >>> If I open the first of these, Firefox reports
> >>>
>  Access to the file was denied
> 
>  The file at
>  /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
>  is not readable.
> 
>  It may have been removed, moved, or file permissions may be 
> preventing access.
> >>> However I have both read and write privileges for this file: ```ls 
> -l /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html``` 
> returns
> >>>
>  -rw-rw-r-- 1 brett brett 667 Mar 25 10:15 
> /home/brett/.local/share/jupyter/runtime/nbserver-101452-open.html
> >>> I tried changing the privil