ibis-project / ibis-ml

IbisML is a library for building scalable ML pipelines using Ibis.
https://ibis-project.github.io/ibis-ml/
Apache License 2.0
96 stars 13 forks source link

No module named 'numpy' on default install #151

Closed lostmygithubaccount closed 2 months ago

lostmygithubaccount commented 2 months ago

to reproduce install gh/uv:

gh repo clone ibis-project/ibis-ml
cd ibis-ml
uv venv
. .venv/bin/activate
uv pip install -e .

then try importing IbisML:

import ibis_ml as ml

traceback:

[ins] In [1]: import ibis_ml as ml
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import ibis_ml as ml

File ~/repos/ibis-ml/ibis_ml/__init__.py:7
      3 __version__ = "0.1.2"
      5 import pprint
----> 7 from ibis_ml.core import Recipe, Step
      8 from ibis_ml.select import (
      9     categorical,
     10     cols,
   (...)
     27     where,
     28 )
     29 from ibis_ml.steps import *

File ~/repos/ibis-ml/ibis_ml/core.py:15
     13 import ibis.expr.operations as ops
     14 import ibis.expr.types as ir
---> 15 import numpy as np
     16 import pandas as pd
     17 import pyarrow as pa

ModuleNotFoundError: No module named 'numpy'

numpy and pandas were removed as required dependencies for the default installation of Ibis: https://github.com/ibis-project/ibis/pull/9564

deepyaman commented 2 months ago

Thanks for raising. The NumPy and pandas dependencies should only be required when working with these data types (e.g. they shouldn't be needed when working with Polars dataframes), so it's mostly a question of importing in the scope of these functions. @jitingxu1 I see you had already looked at this issue; can you see if can update your PR (or raise a new PR) to do this?