`numpy.lib.recfunctions.structured_to_unstructured`: AttributeError with --standalone
See original GitHub issue- Nuitka version, full Python version, flavor, OS
1.0.6
Commercial: 1.0.0
Python: 3.10.7 (main, Sep 8 2022, 14:34:29) [GCC 12.2.0]
Flavor: Debian Python
Executable: /tmp/nptest/bin/python
OS: Linux
Arch: x86_64
Distribution: Debian sid
- How did you install Nuitka and Python
pip install
of the main branch of Nuitka-commercial (or alternatively the develop branch) into an fresh venv
.
- The specific PyPI names and versions
Nuitka @ file:///tmp/Nuitka-commercial
numpy==1.23.3
ordered-set==4.1.0
- Many times when you get an error from Nuitka, your setup may be special
Hello world works fine.
- Also supply a Short, Self Contained, Correct, Example
The following example nptest.py
import numpy as np
from numpy.lib import recfunctions as rfn
if __name__ == '__main__':
a = np.zeros(4, dtype=[('a', 'i4'), ('b', 'f4,u2'), ('c', 'f4', 2)])
print(rfn.structured_to_unstructured(a))
should produce the following output:
[[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]]
But after compiling standalone via python -m nuitka --standalone --enable-plugin=numpy nptest.py
, I get the following error:
Traceback (most recent call last):
File "/tmp/nptest/src/nptest.dist/nptest.py", line 7, in <module>
File "/tmp/nptest/src/nptest.dist/numpy/core/overrides.py", line 180, in public_api
File "/tmp/nptest/src/nptest.dist/numpy/lib/recfunctions.py", line 975, in structured_to_unstructured
AttributeError: 'NoneType' object has no attribute 'filter'
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Structured arrays — NumPy v1.25.dev0 Manual
lib.recfunctions.repack_fields converts an aligned dtype or array to a packed one and vice versa. It takes either a dtype or structured ndarray as...
Read more >can't see 'recfunctions' after 'import numpy' · Issue #4242
Correcting the doc would go a long way. It seems unusual to have what appears to be an actively supported sub-module that is...
Read more >Adding a field to a structured numpy array (3) - Stack Overflow
According to the git history, numpy.lib.recfunctions hasn't gone ... AttributeError: 'module' object has no attribute 'recfunctions' ...
Read more >Python: module numpy.lib.recfunctions - PyOpenGL
Returns an iterator of concatenated fields from a sequence of arrays, collapsing any nested structure. append_fields(base, names, data=None, dtypes=None, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed on https://nuitka.net/doc/factory.html and will be release as part of 1.1 soon.
This is part of the stable release 1.1 that I just made.