I am experimenting with another module (pyswarms) which isn't installed on 
Sagecells. I can work with it in CoCalc after installing it into my project.
Such a situation, requiring particular modules for particular purposes, may 
happen frequently and I wonder whether there could be provided a way to 
install modules for a session such that they can be called using import, 
perhaps as another parameter for sagecells or for collections of linked 
sagecells. Perhaps internally some statistics could be maintained for 
Andrey to decide whether a permanent installation on the Sagecell system is 
worth the effort.

[email protected] schrieb am Montag, 25. Januar 2021 um 16:56:51 UTC+1:

> Thank you William for pointing out CoCalc. I tested the code, it took some 
> time before producing results, there is stricter limitation on CPU usage 
> and time I guess. 
>
> Hope Tkinter will be installed on Sage Server sometime in the future, it 
> is community-driven, conveniently brings many things together, and works 
> very well out of the box for most of the installed applications.
>
> @Andrey Novoseltsev 
>
> I tested Theano and some printing/graphing dependencies seem to be lacking 
> following the error "RuntimeError: ('Failed to import pydot. You must 
> install graphviz and either pydot or pydot-ng for `pydotprint` to work.', 
> 'Install the python package pydot or pydot-ng. Install graphviz.')".
>
> The missing dependencies are all pip installable:
>
> - pip install pydot (https://pypi.org/project/pydot/)
> - pip install graphviz (https://pypi.org/project/graphviz/)
> - https://pypi.org/project/pydot-ng/ (https://pypi.org/project/pydot-ng/)
>
> Kind regards,
>
> Elimboto
>
> On Mon, Jan 25, 2021 at 7:57 AM William Stein <[email protected]> wrote:
>
>> > There are a number of discussions on the internet on how to do this, 
>> but I have not succeeded, they need more time to explore and test.
>>
>> For what it is worth (since cocalc is not sagecell), you can do this in 
>> https://cocalc.com as follows:
>>
>> 1. In a CoCalc project, click +New --> "X11 Desktop"
>> 2. In the terminal in the upper left, type "python3".
>> 3. Paste in your code. 
>>
>> This is what it looks like:
>>
>> [image: image.png]
>>
>> NOTE: Your code downloads a data file from the internet and free cocalc 
>> project block outside network, so you'll have to upload the file to cocalc 
>> first.
>>
>> CoCalc does have a button to share things publicly (to 
>> https://share.cocalc.com/share/), and things shared there can be used by 
>> people without creating a cocalc account.
>>
>> > Yes, for other plotting backends, the option is either displaying the 
>> plots by inlining them on the web or saving the results to html and then 
>> displaying the figure on a browser upon clicking
>>
>> Technically the way cocalc is solving this particular problem is a third 
>> option -- run an X11 server (in this case xpra), and implement an X11 
>> client right in the browser.     It was a lot of work, but it at least 
>> results in something that fullly supports tkinter, which is sometimes very 
>> valuable to people...
>>
>>  -- William
>>
>>
>> On Sun, Jan 24, 2021 at 10:34 PM Elimboto Yohana <[email protected]> wrote:
>> >
>> > Thank you Andrey for your reply and for installing the packages.
>> >
>> > Tkinter and turtle are installed but none of the examples that use them 
>> seem to work as you already pointed out. For tkinter I have tried to save 
>> results to a file and then try to plot, but the common error for now is 
>> "TclError: no display name and no $DISPLAY environment variable". Try for 
>> example the code below and see how you could figure out to save results and 
>> then plot:
>> >
>> > import nltk
>> > from nltk.corpus import treebank
>> > nltk.download('treebank')
>> > t = treebank.parsed_sents('wsj_0001.mrg')[0]
>> > print(t)
>> > t.draw()
>> >
>> > There are a number of discussions on the internet on how to do this, 
>> but I have not succeeded, they need more time to explore and test.
>> >
>> > Yes, for other plotting backends, the option is either displaying the 
>> plots by inlining them on the web or saving the results to html and then 
>> displaying the figure on a browser upon clicking, the second option works 
>> well for interactive Plotly plots (see attached).
>> >
>> > As for Dash, the problem seems to be Flask environment variable 
>> settings (PATH environment variable) because Dash is built on top of it. 
>> This may look something close to what is discussed at 
>> https://flask.palletsprojects.com/en/1.1.x/config/#configuring-from-files
>> >
>> > Dash is useful for creating interactive web analytics/apps.
>> >
>> > Kind regards,
>> >
>> > Elimboto
>> >
>> >
>> > On Sun, Jan 24, 2021 at 5:32 PM Andrey Novoseltsev <[email protected]> 
>> wrote:
>> >>
>> >> Hi Elimboto!
>> >>
>> >> Thanks for your patience - I've finally installed the packages you 
>> have asked for and compiled Python with tkinter support, although I am not 
>> sure it will achieve what you want - you can't open TK windows via 
>> SageMathCell. What all other graphics backends are doing is saving results 
>> to a file and then this file is displayed in the user browser. Do you plan 
>> to do the same? Incidentally, I just got a question about turtle graphics 
>> support which also relies on tkinter, but their examples are not working 
>> right away because of display issues.
>> >>
>> >> As for dash - what are you trying to achieve with it? We can set 
>> environment variables or create some configuration files, but I need to 
>> have more direct instructions and understanding of what is going on. There 
>> are plenty of packages installed on public servers and vast majority just 
>> needs to be installed without any extra tinkering.
>> >>
>> >> Best,
>> >> Andrey
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google 
>> Groups "sage-cell" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send 
>> an email to [email protected].
>> >> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-cell/3e4aa51f-8efd-4928-ba24-e425608c0a28n%40googlegroups.com
>> .
>> >
>> > --
>> > You received this message because you are subscribed to the Google 
>> Groups "sage-cell" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to [email protected].
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-cell/CACEZTmtQ%2Bzy5Jc%2BBA%3D-fihxQnKpKSMqDxQvZKRdyhg60yNQ49g%40mail.gmail.com
>> .
>>
>>
>>
>> -- 
>> William (http://wstein.org)
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-cell" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-cell/CACLE5GCuL2VgornZwSut_f9mXfvu48cHq%3DwhFrcwQX%3DFHusyng%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/sage-cell/CACLE5GCuL2VgornZwSut_f9mXfvu48cHq%3DwhFrcwQX%3DFHusyng%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-cell/bda675be-41c0-4008-972b-95b2aa90815en%40googlegroups.com.

Reply via email to