Comments (5)
@NigamSomya To install the Python package from a local copy of LightGBM, run the following:
sh build-python.sh install
For details on how to customize that, follow the docs at https://github.com/microsoft/LightGBM/blob/master/python-package/README.rst. You can ask here if you have other questions or concerns.
from lightgbm.
Hi! Thanks that worked successfully, but it installed the package in this directory C:\Users\snigam\AppData\AppData2\Lib\site-packages\lightgbm\ which is not picking up the changes that I made to the dcg_calculator.cpp
Plus, when I cloned the source code in a different directory, I expected the command that you shared would install the necessary files in that directory only. Please help.
from lightgbm.
which is not picking up the changes that I made to the dcg_calculator.cpp
What evidence do you see the the changes you've made to LightGBM's source code are not being picked up in the Python package?
Just to be sure you understand...the Python package will not contain any .h
or .cpp
files. Those files are compiled into a shared library, lib_lightgbm.dll
, that the Python package code calls.
If you run the command I show you from the root of the same repo where you changed any .cpp
files in LightGBM, the resulting Python package will reflect your changes. Be sure you're doing that.
I expected the command that you shared would install the necessary files in that directory only.
The command I shared will build the lightgbm
Python package and install it to where pip install
on your system places packages by default.
If you want to control that more tightly, omit the install
.
sh build-python.sh bdist_wheel
That will create a file with a name like lightgbm-4.3.0.99-py3-none-win_amd64.whl
in the dist/
directory at the root of the LightGBM repo. That file is a Python wheel and you can install it to wherever you want.
from lightgbm.
Hi!
Because I am getting the same error (kMaxposition error), I also ran the command in the same directory where my source code is place but somehow it gets installed as if I am running the usual pip command to install the lightgbm (in the usual appdata directory).
Also, the same thing happened when I tried to use this command sh build-python.sh bdist_wheel. Couldn't find anything named lightgbm-4.3.0.99-py3-none-win_amd64.whl. Must have been installed in the default directory and it behaves like the usual lightgbm package.
I am not sure what I am doing wrong, can you please help me with this?
from lightgbm.
somehow it gets installed as if I am running the usual pip command to install the lightgbm (in the usual appdata directory).
LightGBM's Python package does not support editable installs.
This command builds a wheel and installs it with pip install
:
sh build-python.sh bdist_wheel install
This command builds a wheel and places it in the directory ./dist
, relative to the root of the repo:
sh build-python.sh bdist_wheel
And then you are free to install it however you'd install other Python wheels. For example, like this:
pip install --no-deps ./dist/lightgbm-4.3.0.99-py3-none-win_amd64.whl
Because I am getting the same error (kMaxposition error)
To help you, we need more information than what you've provided.
- what version of LightGBM? (output of
git log -n 2
) - what version of Python?
- can you share all of the build and installation logs?
Some things to try:
- be sure you save the file
dcg_calculator.cpp
before compiling - be sure the Python interpreter used wherever you're running your program is the same one that was active from wherever you installed LightGBM
- for example, if you are running your training code in a separate environment managed by
venv
/conda
/poetry
, then you need to installlightgbm
into that environment - for example, if you are using a Jupyter notebook or similar, you may need to restart the kernel
- for example, if you are running your training code in a separate environment managed by
from lightgbm.
Related Issues (20)
- C API refitting HOT 6
- [python-package] bug : dump_model json loads failed HOT 2
- [R-package] latest {Matrix} requires R>=4.4.0
- [RFC] remove 'categorical_feature' and 'feature_name' parameters in cv() and train() HOT 6
- [RFC] remove HDFS support? HOT 3
- [RFC] provide Python/R implementations of all the built-in objectives? HOT 1
- [python-package] Error in installation in github MacOS runners HOT 2
- [docs] readthedocs builds are broken HOT 1
- CMake `__BUILD_FOR_R` fails to find R source files HOT 4
- [docker] Update Tutorial for Installing LightGBM GPU on Docker Environment HOT 3
- [python-package] NumPy 2.0 support HOT 1
- LightGBM failed to testlightgbm.exe on MSVC HOT 1
- Lightgbm trains much slower than catboost. HOT 15
- Any suggestions for predicting all values to be 0? HOT 1
- [python-package] How to refit a classifier? HOT 4
- Uncertainty in LightGBM (again) HOT 4
- Can not predict with multithread? HOT 5
- [ci] CUDA 11.8 wheel (gcc) CI jobs failing: 'libomp.so.5: no such file or directory'
- [GPU] lightgbm.basic.LightGBMError: Check failed: (best_split_info.left_count) > (0), lightgbm.basic.LightGBMError: Check failed: (best_split_info.right_count) > (0)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightgbm.