0

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:

I have found that this issue is in Debian as well according to the following link: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1686014.html

N0rbert
  • 99,918
manzar
  • 1
  • 1
  • 1
    What is test.py? Can you share its contents? – N0rbert Nov 27 '21 at 19:48
  • for sure. It is the implementation of KYBER algorithm: https://github.com/fvirdia/lwe-on-rsa-copro – manzar Nov 27 '21 at 20:01
  • for sure. it is the implementation of KYBER algorithm. https://github.com/fvirdia/lwe-on-rsa-copro – manzar Nov 27 '21 at 20:04
  • You can try to adapt a workaround for your case. – N0rbert Nov 27 '21 at 20:22
  • Thank you for your response. I have seen this. I will try it. As I said I have seen that this issue is in Debian. It has been said "which gives an error on Debian unstable as of 2019-12-27", How about Ubuntu? – manzar Nov 27 '21 at 20:39
  • I can reproduce this on Ubuntu 20.04.3 LTS. – N0rbert Nov 27 '21 at 20:40
  • Thank you for your response. By "I can reproduce this on Ubuntu 20.04.3 LTS" you mean that you have not received any error? Would you please give me more information on how could I run it? – manzar Nov 27 '21 at 20:44
  • I mean that I have seen original "FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/sagemath/build/pkgs'" error on 20.04.3 LTS. Workaround worked partially, but maybe I'm doing something wrong. – N0rbert Nov 27 '21 at 20:45
  • Thank you for your time. I will try it. Just to clarify: I should add: # For the tests class SageTest(TestCommand): def run_tests(self): errno = os.system("PYTHONPATH=pwd sage -t --force-lib --optional=sage sage_numerical_backends_coin") if errno != 0: sys.exit(1) Or should I replace the value of: sage_numerical_backends_coin? – manzar Nov 27 '21 at 20:54
  • I tried "PYTHONPATH=`pwd` sage -t --force-lib --optional=sage test.py" – N0rbert Nov 27 '21 at 20:58
  • Thank you for your time. I tried it. I add the following to the test.py: # For the tests class SageTest(TestCommand): def run_tests(self): errno = os.system("PYTHONPATH=pwd sage -t --force-lib --optional=sage test.py") if errno != 0: sys.exit(1) but still received that error. – manzar Nov 27 '21 at 21:07

0 Answers0