File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,34 @@ bool Optimize::Run() {
9999 std::cerr << " Done calling py::initialize_interpreter\n " ;
100100
101101
102+ // Test if we can import the core numpy extension directly
103+ std::cerr << " Testing numpy core extension import...\n " ;
104+ try {
105+ py::exec (" import numpy.core.multiarray" );
106+ std::cerr << " numpy.core.multiarray import: SUCCESS\n " ;
107+ } catch (py::error_already_set &e) {
108+ std::cerr << " numpy.core.multiarray FAILED: " << e.what () << " \n " ;
109+ }
110+
111+ // Test if we can import numpy's _internal module
112+ std::cerr << " Testing numpy._internal import...\n " ;
113+ try {
114+ py::exec (" import numpy._internal" );
115+ std::cerr << " numpy._internal import: SUCCESS\n " ;
116+ } catch (py::error_already_set &e) {
117+ std::cerr << " numpy._internal FAILED: " << e.what () << " \n " ;
118+ }
119+
120+ // Test basic DLL loading capability
121+ std::cerr << " Testing basic extension import...\n " ;
122+ try {
123+ py::exec (" import _ctypes" ); // This is a built-in extension
124+ std::cerr << " _ctypes import: SUCCESS\n " ;
125+ } catch (py::error_already_set &e) {
126+ std::cerr << " _ctypes FAILED: " << e.what () << " \n " ;
127+ }
128+
129+
102130 // Test the actual failing import to get the real error
103131 std::cerr << " Testing numpy.__config__ import directly...\n " ;
104132 try {
You can’t perform that action at this time.
0 commit comments