google / yggdrasil-decision-forests

A library to train, evaluate, interpret, and productionize decision forest models such as Random Forest and Gradient Boosted Decision Trees.
https://ydf.readthedocs.io/
Apache License 2.0
447 stars 49 forks source link

Cannot import ydf from windows vsc #69

Closed ShadeChen closed 6 months ago

ShadeChen commented 7 months ago

Hi, I tried to install ydf via pip instdall ydf

It shows that I've install a version 0.0.5 of ydf.

when I'm trying to import ydf into the notebook, it pops up error showing as follows:

ImportError: cannot import name 'ydf' from 'ydf.cc' (c:\Users**\AppData\Local\Programs\Python\Python311\Lib\site-packages\ydf\cc__init__.py)

Any idea how I can fix this?

rstz commented 7 months ago

Hi, thank you for trying out YDF. Can you please tell me more about your configuration? It looks like you're using Windows with Python 3.11 - yet we haven't released a Windows version for 0.0.5 - is this through WSL?

ShadeChen commented 7 months ago

Hi,

Currently I'm just runnig within Windows 11 Pro, not in WSL environment with python 3.11 I've tried pip uninstall ydf then pip install ydf again. 屏幕截图 2023-11-29 100336 屏幕截图 2023-11-29 100255

There is somehow another 0.0.6 of ydf here but still cannot import that into the notebook

achoum commented 6 months ago

Hi Shade,

Thank you for the details and your patience :).

YDF 0.0.5 was not released for Windows, which caused Windows pip to attempt (and fail) to compile YDF from the sources available on pypi. We will solve the situation in the next release.

A temporary solution that would have worked would have been to specify version 0.0.4, which had precompiled Windows support at the time.

The current version of YDF 0.0.7 has support for Windows, Linux and MacOS. Could you try again to run pip install ydf -U ?

achoum commented 6 months ago

@rstz I think we simply need to make sure the ydf-.tar.gz file is not uploaded to pypi.

rstz commented 6 months ago

Makes sense, I'll make sure that this file is no longer uploaded in future versions.

JasperFrancois commented 1 month ago

Hi @achoum and @rstz I have installed the latest version of ydf (0.0.7) while working on Windows and I encounter the same issues ShadeChen described above. image image