Trouble with sage installation on Ubuntu 11.04

94 views
Skip to first unread message

Alex Lara

unread,
Apr 29, 2011, 2:51:31 PM4/29/11
to sage-support, lro...@uady.mx
Dear all,

Sage failed to install in ubuntu 11.04. I get the following error:

ImportError: No module named crypt
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.


Any idea of how to fix this?

Thanks in advance:


Alex Lara.

kcrisman

unread,
Apr 29, 2011, 3:41:03 PM4/29/11
to sage-support
Thanks for the report. Did you built from scratch, or download?

You may find http://trac.sagemath.org/sage_trac/ticket/11243 and the
thread http://groups.google.com/group/sage-devel/browse_thread/thread/593b9a4124f5075d/8d9bbfef3910dbc5
useful. We are tracking this problem.

- kcrisman

Alex Lara

unread,
Apr 29, 2011, 9:23:35 PM4/29/11
to sage-support
I tried to install from source. I have installed sage many times
before following the installation guide. I will take a look at the
links.

-Alex


On 29 abr, 14:41, kcrisman <kcris...@gmail.com> wrote:
> Thanks for the report.  Did you built from scratch, or download?
>
> You may findhttp://trac.sagemath.org/sage_trac/ticket/11243and the
> threadhttp://groups.google.com/group/sage-devel/browse_thread/thread/593b9a...

William Stein

unread,
Apr 30, 2011, 1:01:46 AM4/30/11
to sage-s...@googlegroups.com, lro...@uady.mx
On Fri, Apr 29, 2011 at 11:51 AM, Alex Lara <lrod...@gmail.com> wrote:
> Dear all,
>
> Sage failed to install in ubuntu 11.04. I get the following error:
>
> ImportError: No module named crypt
> Error importing ipy_profile_sage - perhaps you should run %upgrade?
> WARNING: Loading of ipy_profile_sage failed.
>
>
> Any idea of how to fix this?

A random shot in the dark is that you could try:

(1) installing the libssl-devel Ubuntu package with "sudo apt-get
install libssl-devel".

(2) rebuild the Python spkg in Sage:

cd SAGE_ROOT
./sage -f python

I have *not* tested this; it's just the first thing I would try, since
the error "no module named crypt" is a symptom of not having the crypt
module compiled into Python, which might happen if the libssl-devel
Ubuntu package isn't installed when you build Sage.

-- William

P.S. For a short while we used to include openssl with Sage, which
avoided such problems, but it turned out at the time that the openssl
license is GPL-incompatible, so it's somewhat unclear that we can
legally include it in Sage.


>
> Thanks in advance:
>
>
> Alex Lara.
>

> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Jan Groenewald

unread,
Apr 30, 2011, 2:35:27 AM4/30/11
to sage-s...@googlegroups.com
Hi

On Fri, Apr 29, 2011 at 10:01:46PM -0700, William Stein wrote:
> A random shot in the dark is that you could try:
>
> (1) installing the libssl-devel Ubuntu package with "sudo apt-get
> install libssl-devel".

It's libssl-dev on Ubuntu (remove the "el" at the end).
But I can build sage/python without that package though.

> (2) rebuild the Python spkg in Sage:
>
> cd SAGE_ROOT
> ./sage -f python

It needs a one line patch on Ubuntu. Try instead (take note this is a work in
progress):

cd SAGE_ROOT/spkg/standard
wget http://users.aims.ac.za/~jan/python-2.6.4.p10.spkg
sage -f python-2.6.4.p10.spkg

( Note that only works after you did 'cd SAGE_ROOT; make', and it failed
to build the crypt module in the python spkg, but the other packages
are built.

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

Alex Lara

unread,
Apr 30, 2011, 4:59:00 PM4/30/11
to sage-support
The command ./sage -f python (after install libssl-dev) did not work,
but sage -f python-2.6.4.p10.spkg did work (I think).
I ran make test. The following test failed:

sage -t -force_lib "devel/sage/sage/rings/number_field/
number_field.py"

Do you think my build is ok now?

Best regards---Alex

On 30 abr, 01:35, Jan Groenewald <j...@aims.ac.za> wrote:
> Hi
>
> On Fri, Apr 29, 2011 at 10:01:46PM -0700, William Stein wrote:
> > A random shot in the dark is that you could try:
>
> >   (1) installing the libssl-devel Ubuntu package with "sudo apt-get
> > install libssl-devel".
>
> It's libssl-dev on Ubuntu (remove the "el" at the end).
> But I can build sage/python without that package though.
>
> >   (2) rebuild the Python spkg in Sage:
>
> >        cd SAGE_ROOT
> >        ./sage -f python
>
> It needs a one line patch on Ubuntu. Try instead (take note this is a work in
> progress):
>
>         cd SAGE_ROOT/spkg/standard
>         wgethttp://users.aims.ac.za/~jan/python-2.6.4.p10.spkg

Dr. David Kirkby

unread,
May 1, 2011, 3:52:20 AM5/1/11
to sage-s...@googlegroups.com
On 04/30/11 09:59 PM, Alex Lara wrote:
> The command ./sage -f python (after install libssl-dev) did not work,
> but sage -f python-2.6.4.p10.spkg did work (I think).
> I ran make test. The following test failed:
>
> sage -t -force_lib "devel/sage/sage/rings/number_field/
> number_field.py"
>
> Do you think my build is ok now?
>
> Best regards---Alex

In a word, No. What version of Sage are you trying to build?

Can you show us the output of the test log file (test.log, ptest.log,
ptestlong.log or whatever it is in your case). We need to see the bit where the
test fails - not the complete log.

If you have not run the long tests, I suggest you run them too.


$ make testlong
(run each test serially)

or

$ make ptestlong
(if you have a multi-core and/or multi-processor machine, which will run tests
in parallel to reduce the time needed to run them).

I have a faint recollection of "number_field.py" might have failed on one of the
recent alpha releases, but has been fixed. Depending on what you are using, you
might have hit a problem that's been solved. But I could be mistaken about this
anyway - I lose track of the test failures, which are quite common in the early
alpha releases.


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Alex Lara

unread,
May 1, 2011, 10:25:47 AM5/1/11
to sage-support
I'm trying to build sage 4.6.2 from source. The output is here

http://dl.dropbox.com/u/5510419/test.log

I will run the long test and as soon as it finishes I will post the
output.

Best wishes---Alex

Jan Groenewald

unread,
May 1, 2011, 10:58:09 AM5/1/11
to sage-s...@googlegroups.com
Hi

On Sun, May 01, 2011 at 07:25:47AM -0700, Alex Lara wrote:
> I'm trying to build sage 4.6.2 from source. The output is here
> http://dl.dropbox.com/u/5510419/test.log
> I will run the long test and as soon as it finishes I will post the
> output.

If your sage starts without an error about failing to import crypt, then
your build is OK as regards the python on Ubuntu 11.04 issue.

The fix is in sage 4.7 due out very soon.

Currently sage 4.6.2 finishes building python on Ubuntu 11.04 without
exiting, but fails to build the crypt module. You can even use much
of sage, but not the notebook, and with the 'import crypt failed' error
whenever you start sage. The new python spkg fixes the issue,
and will exit on any platform if the crypt module fails to build.

(make testlong doesn't show this error; it is a python build issue)

Anyone who built sage 4.6.2 on Ubuntu 11.04 can in the meantime (until sage 4.7),
after having built sage by running make, fix their installation with

sage -f http://users.aims.ac.za/~jan/python-2.6.4.p10.spkg

Bill

unread,
Jun 6, 2011, 12:18:41 PM6/6/11
to sage-s...@googlegroups.com
I noticed this thread on crypt after compiling sage 4.7 on Mint 11.04 and failing due to this error.  I tried compiling the same  sage4.7.tar file on Ubuntu 11.04 and was successful.

I was wondering.  Since Mint is built on top of Ubuntu 11.04, is the fix in sage 4.7  hard coded to recognize Ubuntu 11.04?  Could the same fix be expanded so that compiling would succeed on Mint as well?

Bill Odefey

Jan Groenewald

unread,
Jun 6, 2011, 1:00:03 PM6/6/11
to sage-s...@googlegroups.com
Hi Bill,

Please type this in a terminal:

cat /etc/issue > mint-issue.txt

And post the file mint-issue.txt back as an attachment.
(To get the tabs and spaces just right a text attachment
is better.)

William Odefey

unread,
Jun 6, 2011, 1:22:57 PM6/6/11
to sage-s...@googlegroups.com
I typed it and nothing hapeened.  I guess I do not understand what I am to expect.

Jan Groenewald

unread,
Jun 6, 2011, 2:42:29 PM6/6/11
to sage-s...@googlegroups.com
HI

On Mon, Jun 06, 2011 at 12:22:57PM -0500, William Odefey wrote:
> I typed it and nothing hapeened. I guess I do not understand what I am to
> expect.

You won't see anything, but you will create the file mint-issue.txt in your
home folder. Please post that.

Jan Groenewald

unread,
Jun 8, 2011, 12:52:16 AM6/8/11
to sage-s...@googlegroups.com, wod...@iun.edu
Hi

This is now http://trac.sagemath.org/sage_trac/ticket/11447

Bill, please replace SAGE_ROOT/spkg/standard/python-2.6.4.p10.spkg
with http://users.aims.ac.za/~jan/python-2.6.4.p11.spkg, and then
run make again.

Reply all
Reply to author
Forward
0 new messages