3-manifolds / SnapPy

SnapPy is a package for studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures. It is based on the SnapPea kernel written by Jeff Weeks.
https://snappy.computop.org/
84 stars 39 forks source link

TypeError: can't set attributes of built-in/extension type 'type' #22

Closed maresb closed 3 years ago

maresb commented 3 years ago

On import snappy with SnapPy 2.8 from PyPi and Python 3.9.1 on Linux I got

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-4b977935db88> in <module>
----> 1 import snappy
      2 from snappy import Manifold

~/conda/envs/sage/lib/python3.9/site-packages/snappy/__init__.py in <module>
      5 #logging.debug('This message should go to the log file')
      6 import sys
----> 7 from .SnapPy import (AbelianGroup, HolonomyGroup, FundamentalGroup,
      8                      DirichletDomain, CuspNeighborhood, SymmetryGroup,
      9                      AlternatingKnotExteriors, NonalternatingKnotExteriors,

cython/core/fundamental_group.pyx in init SnapPy()

cython/core/fundamental_group.pyx in SnapPy.HolonomyGroup.use_field_conversion()

TypeError: can't set attributes of built-in/extension type 'type'

Upon downgrading to Python 3.8.6 I can import successfully.

I notice that you already added tests for Python 3.9, so I figure you're probably on top of this already. But I wanted to report it anyway in case someone else has this error. Thanks!

NathanDunfield commented 3 years ago

Ben, many thanks for the report! Could you check whether or not the development version works for you, e.g. with

python3 -m pip https://github.com/3-manifolds/SnapPy/archive/master.zip
python3 -m snappy.test

I expect it will, but it's always good to have another data point. Also, the development version is in good shape at the moment, so it's safe to use if you prefer to stick with Python 3.9.

maresb commented 3 years ago

Hi Nathan, thanks for the quick response! The development version does indeed work. (Minor correction in the above command: pippip install.)

I'm a big fan of your work, and all this software is very helpful!