Ask Your Question
1

sagemath : sage test fail

asked 2021-11-27 22:20:15 +0200

manzar gravatar image

updated 2021-11-28 01:54:12 +0200

slelievre gravatar image

I got the following error while running the sage -t command.

$ sage -t test.py
Traceback (most recent call last):
  File "/usr/share/sagemath/bin/sage-runtests", line 178, in <module>
    DC = DocTestController(options, args)
  File "/usr/lib/python3/dist-packages/sage/doctest/control.py", line 358, 
in __init__
    for pkg in list_packages('optional', local=True).values():
  File "/usr/lib/python3/dist-packages/sage/misc/package.py", line 236, in 
list_packages
    for p in os.listdir(SAGE_PKGS):
FileNotFoundError: [Errno 2] No such file or directory: 
'/usr/share/sagemath/build/pkgs'

I attached the following information about the version:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04

Python 3.8.10

$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.8.10. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage:
edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Thank you for your question.

slelievre gravatar imageslelievre ( 2021-11-28 01:54:37 +0200 )edit

How did you install Sage?

What are you trying to test?

slelievre gravatar imageslelievre ( 2021-11-28 01:54:48 +0200 )edit

I install Sage by Linux Package Manager : sudo apt install sagemath . It is the implementation of KYBER algorithm: https://github.com/fvirdia/lwe-on-rsa...

manzar gravatar imagemanzar ( 2021-11-28 07:31:41 +0200 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2021-11-28 13:55:35 +0200

eric_g gravatar image

updated 2021-11-29 14:44:20 +0200

The Ubuntu package sagemathdoes not offer all the functionalities for advanced use of SageMath, like testing or installing additional packages. I would therefore suggest that you install SageMath in your home directory by downloading the binary image for Ubuntu 20.04 from https://www.sagemath.org/download-lin.... Simply do

sudo apt-get install python-is-python3
tar jxvf sage-9.4-Ubuntu_20.04-x86_64.tar.bz2
cd SageMath
./sage -n jupyter

Then ./sage -t should work from the directory SageMath. As a bonus, you'll get the latest version of Sage (9.4), while the Ubuntu package is only 9.0.

edit flag offensive delete link more
0

answered 2021-12-02 05:44:44 +0200

manzar gravatar image

Thank you for your time and thank you for your response. I have tested this solution. It does not work for me. still get errors.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-11-27 22:20:15 +0200

Seen: 95 times

Last updated: Dec 02 '21