plasma-umass / scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Apache License 2.0
12.16k stars 399 forks source link

'ImportError: numpy.core.multiarray failed to import' when using scalene #595

Open zuble opened 1 year ago

zuble commented 1 year ago

Hii

The script i am running imports the essentia module just fine running alone ( built following this )

However when trying to profile with scalene --reduced-profile es.py it gives the following error:

Unable to import NumPy C API from Essentia module. Error code = -1
Error in program being profiled:
 numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "/home/zu/anaconda3/envs/zugpu/lib/python3.8/site-packages/scalene/scalene_profiler.py", line 1835, in profile_code
    exec(code, the_globals, the_locals)
  File "es.py", line 4, in <module>
    import essentia.standard as es
  File "/usr/local/lib/python3.8/site-packages/essentia/__init__.py", line 1, in <module>
    from . import _essentia
ImportError: numpy.core.multiarray failed to import
Scalene: Program did not run for long enough to profile.
NOTE: The GPU is currently running in a mode that can reduce Scalene's accuracy when reporting GPU utilization.
Run once as Administrator or root (i.e., prefixed with `sudo`) to enable per-process GPU accounting.

I am running in ubuntu 16.04 lts and installed scalene with conda

LuchiLucs commented 1 year ago

Same error on Windows 10, the script imports numpy and pandas. I updated the conda enviroment with latest pandas, numpy and scalene