Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'll post it like an answer, since the truncation of comments was misleading for me. (And there is not too much place in the comments.) I think we are now close to a final answer.

First of all, i could reproduce the error in the following way.

After changing the code in

/usr/lib/python2.7/site-packages/sage/databases/cremona.py

so that i have at least a print,

def __init__(self, name, read_only=True, build=False):
    """
    Initialize the database.

    TESTS::

        sage: c = CremonaDatabase('cremona')    # optional - database_cremona_ellcurve
        sage: c.name                            # optional - database_cremona_ellcurve
        'cremona'
    """
    self.name = name
    name = name.replace(' ','_')
    db_path = os.path.join(SAGE_SHARE, 'cremona', name+'.db')
    print ( "self.name=%s SAGE_SHARE=%s db_path=%s"
            % ( self.name, SAGE_SHARE, db_path ) )    # !!! inserted print

and after asking for it...

sage: import traceback
sage: try:    c = CremonaDatabase('cremona') 
....: except: traceback.print_exc()
....:

was getting my print,

self.name=cremona SAGE_SHARE=/usr/share db_path=/usr/share/cremona/cremona.db

and the traceback information.

Traceback (most recent call last):
  File "<ipython-input-7-1da8056b7fa9>", line 1, in <module>
    try:    c = CremonaDatabase('cremona')
  File "/usr/lib/python2.7/site-packages/sage/databases/cremona.py", line 1695, in CremonaDatabase
    return LargeCremonaDatabase(name)
  File "/usr/lib/python2.7/site-packages/sage/databases/cremona.py", line 1435, in __init__
    + "exist")
ValueError: Desired database (='cremona') does not exist

The desired database is the cremona database, and there is no fallback scenario in this class.

In my install of sagemath this problem does not appear while asking for E = EllipticCurve( '37b2' ), but at least it appeared after trying the above c = CremonaDatabase('cremona') .

As seen above, the code is explicitly searching for cremona.db in the right folder. On my machine there is only:

# ls -l /usr/share/cremona/
total 8196
-rw-r--r-- 1 root root 8392704 22. Okt 2016  cremona_mini.db

Copying or linking the existing mini did not work for me to pass without a traceback, a _cremonaSkeleton mismatch shows in these both cases because the next check block...

At any rate, this is the reason for the error, the cremona_mini.db is not enough for the specific installation on manjaro. (Maybe purging, and reinstalling... This would be my first try in the second day.)

I'll post it like an answer, since the truncation of comments was misleading for me. (And there is not too much place in the comments.) I think we are now close to a final answer.

First of all, i could reproduce the error in the following way.

After changing the code in

/usr/lib/python2.7/site-packages/sage/databases/cremona.py

so that i have at least a print,

def __init__(self, name, read_only=True, build=False):
    """
    Initialize the database.

    TESTS::

        sage: c = CremonaDatabase('cremona')    # optional - database_cremona_ellcurve
        sage: c.name                            # optional - database_cremona_ellcurve
        'cremona'
    """
    self.name = name
    name = name.replace(' ','_')
    db_path = os.path.join(SAGE_SHARE, 'cremona', name+'.db')
    print ( "self.name=%s SAGE_SHARE=%s db_path=%s"
            % ( self.name, SAGE_SHARE, db_path ) )    # !!! inserted print

and after asking for it...

sage: import traceback
sage: try:    c = CremonaDatabase('cremona') 
....: except: traceback.print_exc()
....:

was getting my print,

self.name=cremona SAGE_SHARE=/usr/share db_path=/usr/share/cremona/cremona.db

and the traceback information.

Traceback (most recent call last):
  File "<ipython-input-7-1da8056b7fa9>", line 1, in <module>
    try:    c = CremonaDatabase('cremona')
  File "/usr/lib/python2.7/site-packages/sage/databases/cremona.py", line 1695, in CremonaDatabase
    return LargeCremonaDatabase(name)
  File "/usr/lib/python2.7/site-packages/sage/databases/cremona.py", line 1435, in __init__
    + "exist")
ValueError: Desired database (='cremona') does not exist

The desired database is the cremona cremona database, and there is no fallback scenario in this class.class to look for cremona_mini in case of failure.

In my install of sagemath this problem does not appear while asking for E = EllipticCurve( '37b2' ), but .

But at least it appeared after trying the above c = CremonaDatabase('cremona') .

As seen above, the code is explicitly searching for cremona.db in the right folder. On my machine there is only:

# ls -l /usr/share/cremona/
total 8196
-rw-r--r-- 1 root root 8392704 22. Okt 2016  cremona_mini.db

Copying (Copying or linking the existing mini did not work for me to pass without a traceback, a _cremonaSkeleton mismatch shows in these both cases because the next check block... block...)

At any rate, this is the reason for the error, the cremona_mini.db is not enough for enough. (For the specific installation on manjaro. manjaro, which very probably also has only the cremona mini database in the asked folder.)

(Maybe purging, and reinstalling... This would be my first try in the second day.)

day. The question is why the code is routed to the above line of code in Your installation... )

I'll post it like as an answer, no longer as a comment, since the truncation of comments was misleading for me. (And there is not too much place in the comments.) I think we are now close to a final answer.

First of all, i could reproduce the error in the following way.

After changing the code in

/usr/lib/python2.7/site-packages/sage/databases/cremona.py

so that i have at least a print,

def __init__(self, name, read_only=True, build=False):
    """
    Initialize the database.

    TESTS::

        sage: c = CremonaDatabase('cremona')    # optional - database_cremona_ellcurve
        sage: c.name                            # optional - database_cremona_ellcurve
        'cremona'
    """
    self.name = name
    name = name.replace(' ','_')
    db_path = os.path.join(SAGE_SHARE, 'cremona', name+'.db')
    print ( "self.name=%s SAGE_SHARE=%s db_path=%s"
            % ( self.name, SAGE_SHARE, db_path ) )    # !!! inserted print

and after asking for it...

sage: import traceback
sage: try:    c = CremonaDatabase('cremona') 
....: except: traceback.print_exc()
....:

was getting my print,

self.name=cremona SAGE_SHARE=/usr/share db_path=/usr/share/cremona/cremona.db

and the traceback information.

Traceback (most recent call last):
  File "<ipython-input-7-1da8056b7fa9>", line 1, in <module>
    try:    c = CremonaDatabase('cremona')
  File "/usr/lib/python2.7/site-packages/sage/databases/cremona.py", line 1695, in CremonaDatabase
    return LargeCremonaDatabase(name)
  File "/usr/lib/python2.7/site-packages/sage/databases/cremona.py", line 1435, in __init__
    + "exist")
ValueError: Desired database (='cremona') does not exist

The desired database is the cremona database, and there is no fallback scenario in this class to look for cremona_mini in case of failure.

In my install of sagemath this problem does not appear while asking for E = EllipticCurve( '37b2' ).

But at least it appeared after trying the above c = CremonaDatabase('cremona') .

As seen above, the code is explicitly searching for cremona.db in the right folder. On my machine there is only:

# ls -l /usr/share/cremona/
total 8196
-rw-r--r-- 1 root root 8392704 22. Okt 2016  cremona_mini.db

(Copying or linking the existing mini did not work for me to pass without a traceback, a _cremonaSkeleton mismatch shows in these both cases because the next check block...)

At any rate, this is the reason for the error, the cremona_mini.db is not enough. (For the specific installation on manjaro, which very probably also has only the cremona mini database in the asked folder.)

(Maybe purging, and reinstalling... This would be my first try in the second day. The more important question is why the code is routed to the above line of code in Your installation... )