Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightgbm R installation #3066

Closed
ghost opened this issue May 10, 2020 · 16 comments
Closed

Lightgbm R installation #3066

ghost opened this issue May 10, 2020 · 16 comments

Comments

@ghost
Copy link

ghost commented May 10, 2020

Hi, everyone,

I'm trying to install lightgbm in R (Windows 10, RStudio 3.6.3). I have already read and tried steps in #2995 and #2997 but I have a problem at a stage;

C:\Users\MGS\LightGBM>git fetch origin r/msvc-support
fatal: couldn't find remote ref r/msvc-support

Then I have tried;

C:\Users\MGS\LightGBM>git pull r/msvc-support
fatal: 'r/msvc-support' does not appear to be a git repository.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

But I got an error again. How can I solve this problem?
Thank you so much.

@jameslamb
Copy link
Collaborator

Thanks for using LightGBM.

Please follow the installation instructions in our official documentation: https://github.com/microsoft/LightGBM/blob/master/R-package/README.md#installation

If the instructions do not work, please comment here with some explanation of exactly the code you ran and what error message or other logs you are seeing and we will re-open the issue.

@ghost
Copy link
Author

ghost commented May 12, 2020

I've installed git and CMake(3.16.6)
I've installed Visual Studio Code (April 2020 version) (Actually, I want to use lightgbm in RStudio, so I have RStudio 3.6.3)
I've also installed RTools35.
Then, in cmd I wrote your instructions(both of them) and I get this;
Ekran Görüntüsü (64)
Ekran Görüntüsü (65)

@jameslamb jameslamb reopened this May 12, 2020
@jameslamb
Copy link
Collaborator

Can you show me the value of your PATH environment variable? If make is not found, I suspect that you do not have Rtools directories on your PATH per https://github.com/microsoft/LightGBM/tree/master/R-package#windows-preparation.

By the way, the versions of R and RStudio are two different things. You can get your version of R by running R --version. That is probably 3.6.3.

@ghost
Copy link
Author

ghost commented May 12, 2020

Ekran Görüntüsü (66)

@jameslamb
Copy link
Collaborator

Your PATH looks like it has the right things in it. Did you start a completely new CMD shell after setting those environment variables?

What branch of LightGBM are you on? Your git clone command in the first screenshot failed so I'm not sure what is in the LightGBM directory you're working from.

Could you please start a new CMD window, remove the existing LightGBM directory you have, and run the code from the install instructions?

git clone --recursive https://github.com/microsoft/LightGBM
cd LightGBM
Rscript build_r.R

@ghost
Copy link
Author

ghost commented May 12, 2020

I start a completely new CMD shell after setting environment variables but I got the same error again. Also, I've tried remove the existing LightGBM directory I have but I couldn't do that, so I wrote the command "dir LightGBM", it can be seen below;
Ekran Görüntüsü (67)

@jameslamb
Copy link
Collaborator

Can you please show me the output of running these two commands from that LightGBM folder?

git branch -v

git log -n 5

My concern is that by following comments from the issues you referenced (#2995, #2997), you may have your local LightGBM in a state that doesn't work any more. Since those comments were only temporary fixes for those issues which have now been fixed on master.

@ghost
Copy link
Author

ghost commented May 12, 2020

Ekran Görüntüsü (68)

@jameslamb
Copy link
Collaborator

jameslamb commented May 12, 2020

Great, thanks! Can you please run git pull origin master to get the most recent changes, then try running Rscript build_r.R again?

If you get the same error about make not being found, then we will have to check if your Rtools entries in PATH are set up correctly. I could help with that if you show me a screenshot of Windows Explorer that shows the contents of C:\Program Files\Rtools.

@ghost
Copy link
Author

ghost commented May 12, 2020

I am really grateful for helping you so quickly but I got an error like this when I run "git clone master" so I couldn't try running Rscript build_r.R again.
Ekran Görüntüsü (69)

@jameslamb
Copy link
Collaborator

ha you are fast! I was thinking about two things at once and made a mistake while typing. There was a typo in my comment and I edited it immediately.

It should have been git pull origin master, not git clone master.

@ghost
Copy link
Author

ghost commented May 12, 2020

Okay, so I changed and it has become like this, as a result I got the same error again.
Ekran Görüntüsü (70)
So I also attach the screenshot of C:\Program Files\Rtools
Ekran Görüntüsü (72)

@jameslamb
Copy link
Collaborator

aha! We are getting closer! I noticed that you have C:\Program Files\Rtools in your PATH. Can you please change it to C:\Program Files\Rtools\bin, close this CMD shell, open a new one, and re-run Rscript build_r.R from the root of the LightGBM repository?

I suspect that make is in Rtools\bin but not being found because your path ends in Rtools\.

If that's the case I'll make this clearer in our installation documentation, for those who aren't familiar with Rtools and/or setting their PATH.

@ghost
Copy link
Author

ghost commented May 12, 2020

OH MY GOD! It worked! I have lightgbm package now! You're amazing and I really really appreciate what you are doing and your help. Thank you so much @jameslamb :)

@jameslamb
Copy link
Collaborator

WOO AWESOME! I am glad it's working for you! Thanks for your patience and for using LightGBM!

For those arriving at this issue from search engines:

If you try to build the R package on Windows and get an error like "warning in system(cmd): 'make' not found", be sure that Rtools\bin is on your PATH environment variable.

@github-actions
Copy link

This issue 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 Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant