Question Shashvati Dash · Mar 3, 2025

<class 'ImportError'>: Unable to import required dependencies: numpy: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy so

I have pandas installed inside my C:/InterSystems/IRISHealth/mgr/python

Set pandas=##class(%SYS.Python).Import("pandas")                        
SET pandas=##CLASS(%SYS.Python).Import("pandas")
^
<THROW> *%Exception.PythonException <THROW> 230 ^^0^SET pandas=##CLASS(%SYS.Python).Import("pandas") <class 'ImportError'>: Unable to import required dependencies:
   numpy: Error importing numpy: you should not try to import numpy from
                                                                                its source directory; please exit the numpy source tree, and relaunch
                                                                             your python interpreter from there. - Import

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1 (Build 209U)

Comments

Zion Amsalem · Mar 4, 2025

numpy is dependency and mandatory to run pandas  

and its looks like numpy is missing on the installed environment

before declare pandas you can just do something like this:

pip install --target /InterSystems/IRISHealth/mgr/python numpy

then just check if exist before import pandas

0