Skip to content

Conversation

@jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Jul 7, 2024

Building a Python wheel + installing it like this:

sh build-python.sh bdist_wheel install

Will also overwrite numpy and scipy in the installation environment. When working in a conda environment, that'll also replace conda's numpy / scipy with a wheel from PyPI... which can sometimes lead to undesirable consequences like failed imports.

This could be avoided by just building a wheel yourself and then installing it + telling pip not to overwrite any dependencies, like this:

sh build-python.sh bdist_wheel
pip install --no-deps dist/*.whl

This PR proposes just making that the default behavior, to make local development a bit easier.

It also proposes remove the pip uninstall lightgbm in that script with passing --ignore-installed to pip install... that way the locally-built version overwrites the already-installed one every time, without generating a log message like "WARNING: Skipping lightgbm as it is not installed."

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants