Bug 277495 - math/py-theano out of date wrt numpy
Summary: math/py-theano out of date wrt numpy
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-05 02:35 UTC by Bill Blake
Modified: 2024-03-05 02:35 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (demon)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Blake 2024-03-05 02:35:20 UTC
I wanted to use the Theano python package so I attempted to install it.  That worked.  Then I tried to use it and got this:

/usr/local/lib/python3.9/site-packages/theano/scalar/basic.py:2323: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  self.ctor = getattr(np, o_type.dtype)
Traceback (most recent call last):
  File "/home/user/proj/ai/nndp3/test.py", line 156, in <module>
    import network3
  File "/home/user/proj/ai/nndp3/network3.py", line 37, in <module>
    import theano
  File "/usr/local/lib/python3.9/site-packages/theano/__init__.py", line 124, in <module>
    from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
  File "/usr/local/lib/python3.9/site-packages/theano/scan_module/__init__.py", line 41, in <module>
    from theano.scan_module import scan_opt
  File "/usr/local/lib/python3.9/site-packages/theano/scan_module/scan_opt.py", line 60, in <module>
    from theano import tensor, scalar
  File "/usr/local/lib/python3.9/site-packages/theano/tensor/__init__.py", line 8, in <module>
    from theano.tensor.basic import *
  File "/usr/local/lib/python3.9/site-packages/theano/tensor/basic.py", line 20, in <module>
    from theano.scalar import int32 as int32_t
  File "/usr/local/lib/python3.9/site-packages/theano/scalar/__init__.py", line 3, in <module>
    from .basic import *
  File "/usr/local/lib/python3.9/site-packages/theano/scalar/basic.py", line 2370, in <module>
    convert_to_bool = Cast(bool, name='convert_to_bool')
  File "/usr/local/lib/python3.9/site-packages/theano/scalar/basic.py", line 2323, in __init__
    self.ctor = getattr(np, o_type.dtype)
  File "/usr/local/lib/python3.9/site-packages/numpy/__init__.py", line 313, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Not being a python coder, I'm not sure of the real source of this message, but it apparently will happen any time the Theano package is imported, making that package useless.

This happened with the Theano package and port, both with files fetched today.