[Osgeo4w-trac] [osgeo4w] #823: python3-numba: AttributeError: module 'numpy' has no attribute 'long'

OSGeo4W trac_osgeo4w at osgeo.org
Thu Apr 4 03:17:04 PDT 2024


#823: python3-numba: AttributeError: module 'numpy' has no attribute 'long'
---------------------+--------------------------------
Reporter:  jakimowb  |      Owner:  osgeo4w-dev@…
    Type:  defect    |     Status:  new
Priority:  normal    |  Component:  Package
 Version:            |   Keywords:  numba python numpy
---------------------+--------------------------------
 By now, the latest versions of numba and numpy available in the OSGeo4W
 installer are:
 numba 0.51.2-2 (python3-numba) and
 numpy 1.24.1-1 (python3-nunmpy

 numba 0.51 uses np.long (e.g. in {{{numba/core(types/__init__.py}}}
 ), but this was removed from numpy with version 1.24. This leads to the
 following python import error:

 {{{
 python
 Python 3.9.18 (heads/master:5eba59e, Feb  1 2024, 20:02:10) [MSC v.1929 64
 bit (AMD64)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import numba
 F:\OSGeo4W\apps\Python39\lib\site-
 packages\numba\core\types\__init__.py:108: FutureWarning: In the future
 `np.long` will be defined as the corresponding NumPy scalar.  (This may
 have returned Python scalars in past versions.
   long_ = _make_signed(np.long)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "F:\OSGeo4W\apps\Python39\lib\site-packages\numba\__init__.py",
 line 18, in <module>
     from numba.core import types, errors
   File "F:\OSGeo4W\apps\Python39\lib\site-
 packages\numba\core\types\__init__.py", line 108, in <module>
     long_ = _make_signed(np.long)
   File "F:\OSGeo4W\apps\Python39\lib\site-packages\numpy\__init__.py",
 line 284, in __getattr__
     raise AttributeError("module {!r} has no attribute "
 AttributeError: module 'numpy' has no attribute 'long'
 }}}

 I recommend to update numba to a more recent version, e.g. 0.53.1
 https://github.com/numba/numba/releases
-- 
Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/823>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the Osgeo4w-trac mailing list