Azure / azure-kusto-python

Kusto client libraries for Python
MIT License
183 stars 107 forks source link

ModuleNotFoundError: No module named 'build.lib' in azure-kusto-data #553

Closed subhendu-de closed 1 month ago

subhendu-de commented 1 month ago

Step to reproduce

Create a conda environment

name: prob-mgmt  # Name of the environment
channels:
  - defaults  # Channels to search for packages
dependencies:
  - python=3.9
  - numpy
  - pandas
  - jupyter
  - seaborn
  - pip  # If using pip packages, pip needs to be listed
  - pip:
    - azure-kusto-data  # Example pip package
conda env create -f prob-mgmt.yaml

Jupyter notebook

!pip install Kqlmagic --no-cache-dir  --upgrade
%reload_ext Kqlmagic
from azure.kusto.data import KustoClient, KustoConnectionStringBuilder, ClientRequestProperties

It gives me following issue

image

ericlich001 commented 1 month ago

I had the same problem on the latest version, here is the traceback log on an Azure DevOps build:

Collecting azure-kusto-data[aio] (from -r requirements.txt (line 3))
  Downloading azure_kusto_data-4.6.0-py2.py3-none-any.whl.metadata (4.1 kB)
Traceback (most recent call last):
  File "/home/vsts/work/1/s/*******.py", line 8, in <module>
    from azure.kusto.data import KustoConnectionStringBuilder
  File "/home/vsts/work/1/s/******/.venv/lib/python3.10/site-packages/azure/kusto/data/__init__.py", line 5, in <module>
    from .client import KustoClient
  File "/home/vsts/work/1/s/******/.venv/lib/python3.10/site-packages/azure/kusto/data/client.py", line 17, in <module>
    from build.lib.azure.kusto.data.exceptions import KustoServiceError
ModuleNotFoundError: No module named 'build'
jacwalte commented 1 month ago

+1 - assuming this was not intentional, and the version will be yanked

is from build.lib.azure.kusto.data.exceptions import KustoServiceError

probably should be from azure.kusto.data.exceptions import KustoServiceError

trendmicro-tony-chu commented 1 month ago

Just encountered the same problem here. In my GitHub workflow action YAML file, I have these lines:

- name: install modules run: pip install azure-kusto-data

But it shows the error of "No module name" of that "build.lib" in my Python file at this line:

from azure.kusto.data import KustoClient, ClientRequestProperties

I have to change my YAML file with these lines to fix it:

- name: install modules run: pip install azure-kusto-data==4.5.1

But of course specifying a fixed version in YAML is not a long term solution. This version 4.6.0 needs to be fixed.

AsafMah commented 1 month ago

duplicate of #552