Unable to display graphs from Ubuntu 18.04, Sage 8.3, 64 bit PC

128 views
Skip to first unread message

Graham Gerrard

unread,
Aug 11, 2018, 9:38:24 AM8/11/18
to sage-support
I am using sage from a command prompt ...


show(line2d([(0,0),(1,1),(2,4)])) produces

/home/graham/SageMath/local/lib/python2.7/lib-tk/Tkinter.py in <module>()
     37     # Attempt to configure Tcl/Tk without requiring PATH
     38     import FixTk
---> 39 import _tkinter # If this fails your Python may not be configured for Tk
     40 tkinter = _tkinter # b/w compat for export
     41 TclError = _tkinter.TclError

ImportError: libtk8.6.so: cannot open shared object file: No such file or directory.

Any ideas?

Graham

Jan Groenewald

unread,
Aug 11, 2018, 10:23:07 AM8/11/18
to sage-support
Hi

On Sat, 11 Aug 2018 at 15:38, Graham Gerrard <graham....@gmail.com> wrote:
I am using sage from a command prompt ...


show(line2d([(0,0),(1,1),(2,4)])) produces

/home/graham/SageMath/local/lib/python2.7/lib-tk/Tkinter.py in <module>()
     37     # Attempt to configure Tcl/Tk without requiring PATH
     38     import FixTk
---> 39 import _tkinter # If this fails your Python may not be configuredhttps://packages.ubuntu.com/search?keywords=tk&searchon=names&suite=bionic&section=all for Tk

     40 tkinter = _tkinter # b/w compat for export
     41 TclError = _tkinter.TclError

ImportError: libtk8.6.so: cannot open shared object file: No such file or directory.


Did you install from source? (versus from apt / software centre?)

http://doc.sagemath.org/html/en/installation/source.html#tcl-tk

So it looks like even if you just sudo apt install tk8.6 (and mabye tk8.6-blt2.5??)
your ubuntu python might pick it up but not the sage python.

So you should sudo apt install tk8.6-dev (and mabye tkblt-dev??)
and then rebuild the sage python as per the instructions at the link above.

tk packages in ubuntu 18.04:

Or perhaps there is someone else who can answer if one can tell Sage not to try to use tk for
show(lines(... but to use another graphics toolkit.

Regards,
Jan
--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

Graham Gerrard

unread,
Aug 12, 2018, 7:57:23 AM8/12/18
to sage-s...@googlegroups.com
Hi Jan

I initially installed from the binary tarball.  Successfully tried

sudo apt install tk tk-dev
sage -f python2

Ubuntu18.04 seems to be missing several development tools.  So I guess this will all be resolved when a version of sage for 18.04 is formally released.

Many thanks for your help.

Graham

--
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/xbLE-tPJziI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support+unsubscribe@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Vincent Delecroix

unread,
Aug 12, 2018, 10:28:36 AM8/12/18
to sage-s...@googlegroups.com
Dear Graham,

Note that on Ubuntu 18.04 there is a sagemath and
sagemath-jupyter packages available in apt. They work
with the system Python and simplifies a lot installation.

Best
Vincent
>> sage-support...@googlegroups.com.

Jan Groenewald

unread,
Aug 12, 2018, 10:41:08 AM8/12/18
to sage-support
Hi

I thought there were no binary tarballs for 18.04?
http://files.sagemath.org/linux/64bit/index.html

Regards,
Jan


To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.

To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

--
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 post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Henri Girard

unread,
Aug 12, 2018, 11:45:56 AM8/12/18
to sage-s...@googlegroups.com

Since ubuntu 17.10 I have seen this sagemath and jupyter-notebook which much simplifies  a good installation of sagemath

Graham Gerrard

unread,
Aug 12, 2018, 11:48:27 AM8/12/18
to sage-s...@googlegroups.com
Jan: Sorry, forgot to mention that I used the 16.04 tarball on 18.04.

Vincent: Tried installing sagemath using your recipe.  Works OK for my original problem.  However, have now reverted for several reasons...
(a) 8.1 not 8.3
(b) I usually add packages to the GAP pkg directory.  I didnt find such a directory.  sagemath structure looks very different.
(c) Seems slower than 16.04 tarball solution.

Graham


To unsubscribe from this group and all its topics, send an email to sage-support+unsubscribe@googlegroups.com.

To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

--
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/xbLE-tPJziI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support+unsubscribe@googlegroups.com.

Vincent Delecroix

unread,
Aug 12, 2018, 12:02:28 PM8/12/18
to sage-s...@googlegroups.com
Dear Graham

On 8/12/18 11:48 AM, Graham Gerrard wrote:
> Vincent: Tried installing sagemath using your recipe. Works OK for my
> original problem. However, have now reverted for several reasons...
> (a) 8.1 not 8.3

Indeed. That is the life of packages in a distribution such as
Debian/Ubuntu. You should have 8.3 packaged in few months. But you can
say the same with all packages there: LaTeX, gcc, etc. On the other
hand, Debian guarantees that all these packages live perfectly well
together.

> (b) I usually add packages to the GAP pkg directory. I didnt find such a
> directory. sagemath structure looks very different.

The SageMath on Debian/Ubuntu is using the GAP from the system. Which
means that any GAP package have to be installed from apt
(I don't know if GAP optional packages are available in apt).

Maybe, GAP also provides an alternative way of installing
packages in this situation.

The Sage binary is simple: put everything in one folder (including
Python and possibly gcc!!). The distribution way of thinking is
organized similarly to what you can see in $SAGE_ROOT/local

/usr/bin/ : binaries
/usr/lib/ : libraries
/usr/include/ : header files
/usr/share/ : extra files (eg documentation)

In the Debian way of thinking, it is Sage that is weird.

> (c) Seems slower than 16.04 tarball solution.

This is very weird. Do you have concrete examples (you can actually
measure the time taken by a command using the %time and %timeit
IPython magic).

Vincent

Graham Gerrard

unread,
Aug 12, 2018, 2:26:15 PM8/12/18
to sage-s...@googlegroups.com
Thanks for the helpful comments, Vincent.  Will try again with the official 18.04 version and "think" the Debian way.
Assume that no news is good news and that you have a happy customer.

Graham

Henri Girard

unread,
Oct 3, 2018, 12:34:51 PM10/3/18
to sage-s...@googlegroups.com
HI,
I would like to solve these equations but I don't know how ?

t_0=t_p==gamma*(t-V*x/c^2);show(t_0)
x_0=x_p==gamma*(x-V*t);show(x_0)

solve(t_0,gamma*(t-V*x/c^2))
desolve(gamma*(t-V*x/c^2)==0,x)

error desolve() takes at least 2 arguments (1 given)



Any help ?
Henri

slelievre

unread,
Oct 5, 2018, 3:34:41 AM10/5/18
to sage-support
Dear Henri,

please start a new thread rather than asking a question as a reply
to an unrelated thread.

Kind regards,
Samuel

slelievre

unread,
Oct 5, 2018, 3:41:43 AM10/5/18
to sage-support
On Sun 2018-08-12, 20:26:15 UTC+2, Graham Gerrard wrote:
>
> Thanks for the helpful comments, Vincent. Will try again
> with the official 18.04 version and "think" the Debian way.
> Assume that no news is good news and that you have a happy customer.

Note that other ways to install SageMath under Ubuntu exist.
You could, among other ways,
- use the conda package
- use a Docker image
- use the Nix package

Also, if you like to have the latest version, building from source
is not all that hard.

See the "Distribution" page on the Sage wiki for more information.

HG

unread,
Oct 7, 2018, 1:07:56 AM10/7/18
to sage-support
I installed a fresh cosmic ubuntu 18.10 which should be ready in two weeks about, sage-8.3 is in the repo and is working well
Reply all
Reply to author
Forward
0 new messages