Skip to content

Work-around that CyPari2 has removed prec_words_to_dec #124

@NathanDunfield

Description

@NathanDunfield

With the newest version 2.2.0 of cypari2 importing snappy results in the below error. It seems that CyPari2 has removed prec_words_to_dec. SnapPy uses that function to estimate how many digits of the decimal representation of a volume are correct. Only when running in Sage does SnapPy use CyPari2 (otherwise it uses CyPari). This only affects people using SnapPy in the not-yet released Sage 10.5.

Traceback (most recent call last):
 File "/usr/bin/SnapPy", line 33, in <module>
   sys.exit(load_entry_point('snappy==3.1.1', 'console_scripts',
'SnapPy')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File
"/usr/bin/SnapPy", line 25, in importlib_load_entry_point return
next(matches).load() ^^^^^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205,
in load module = import_module(match.group('module'))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.12/importlib/__init__.py", line 90, in
import_module return _bootstrap._gcd_import(name[level:], package,
level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
 File "<frozen importlib._bootstrap>", line 1310, in
_find_and_load_unlocked File "<frozen importlib._bootstrap>", line 488,
in _call_with_frames_removed File "<frozen importlib._bootstrap>", line
1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360,
in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in
_find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935,
in _load_unlocked File "<frozen importlib._bootstrap_external>", line
995, in exec_module File "<frozen importlib._bootstrap>", line 488, in
_call_with_frames_removed File
"/usr/lib/python3.12/site-packages/snappy-3.1.1-py3.12-linux-x86_64.egg/snappy/__init__.py",
line 6, in <module> from .SnapPy import (AbelianGroup, File
"cython/numbers/double.pyx", line 1, in init SnapPy File
"/usr/lib/python3.12/site-packages/snappy-3.1.1-py3.12-linux-x86_64.egg/snappy/number.py",
line 6, in <module> from .pari import * File
"/usr/lib/python3.12/site-packages/snappy-3.1.1-py3.12-linux-x86_64.egg/snappy/pari.py",
line 17, in <module> from cypari2.pari_instance import
(prec_words_to_dec, ImportError: cannot import name 'prec_words_to_dec'
from 'cypari2.pari_instance'
(/usr/lib/python3.12/site-packages/cypari2/[pari_instance.cpython-312-x86_64-linux-gnu.so](http://pari_instance.cpython-312-x86_64-linux-gnu.so/)).
Did you mean: 'prec_bits_to_dec'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions