pyLightGBM icon indicating copy to clipboard operation
pyLightGBM copied to clipboard

Permission Denied Error?!

Open silverstone1903 opened this issue 8 years ago • 18 comments

I got this error. Any idea? ps: ubuntu 14.04 with python 2.7

lightgbm

silverstone1903 avatar Oct 25 '16 19:10 silverstone1903

Not sure, but maybe you don't have rights to write files on hard drive. Try to change your permissions or try to launch everything in Saudi.

EBazarov avatar Oct 25 '16 19:10 EBazarov

in sudo.

Sorry

EBazarov avatar Oct 25 '16 19:10 EBazarov

@EBazarov I logged as a root user in ubuntu and now I checked the permissions of folder. everything looks normal. Also I launched jupyter notebook with sudo but I got the same error.

silverstone1903 avatar Oct 25 '16 19:10 silverstone1903

You have Windows ? If so try to add ".exe" to the end of exec path.

EBazarov avatar Oct 25 '16 20:10 EBazarov

@EBazarov nope. Still permission denied. Btw thanks for your help.

silverstone1903 avatar Oct 25 '16 20:10 silverstone1903

@silverstone1903 have you been able to solve your problem ? Forgot to mention, but this wrapper has never been tested under python 2, only python 3+

ArdalanM avatar Oct 27 '16 14:10 ArdalanM

@ArdalanM I guess I've tested under Python 2 and it doesn't work 😄

silverstone1903 avatar Oct 27 '16 21:10 silverstone1903

It works under Python 2, but you have to replace following line (occurs 3 times)

line = process.stdout.readline()

with

line = process.communicate()[0]

in models.py. I guess it should work even for Python 3.

martinkersner avatar Nov 10 '16 05:11 martinkersner

@martinkersner thanks for your feedback.

Updated master branch with 63d5a48, hope this solve your problem.

Let me know, Thanks

ArdalanM avatar Nov 10 '16 10:11 ArdalanM

Thanks for your solution advice! @martinkersner

I'll try as soon as possible then I'll give you a feedback. @ArdalanM

silverstone1903 avatar Nov 10 '16 12:11 silverstone1903

@ArdalanM still same, permission denied. I re-installed LightGBM and pyLightGBM but nothing changed. Something related about my PC but I don't have any idea 😞

silverstone1903 avatar Nov 11 '16 13:11 silverstone1903

I get "permission denied" in OS X, but everything is fine in Ubuntu 16.04

ternaus avatar Nov 16 '16 00:11 ternaus

I get permission denied in Windows as well. Could someone help. Here's the exact error:


PermissionError Traceback (most recent call last) in () 21 ) 22 ---> 23 gbmr.fit(X_train, y_train, test_data=[(X_valid, y_valid)]) 24 print("Mean Square Error:", metrics.mean_absolute_error(y_true=(np.exp(y_valid)-1), y_pred=(np.exp(gbmr.predict(X_valid))-1)))

C:\Program Files\Anaconda3\lib\site-packages\pylightgbm\models.py in fit(self, X, y, test_data, init_scores) 129 130 process = subprocess.Popen([self.exec_path, "config={}".format(conf_filepath)], --> 131 stdout=subprocess.PIPE, bufsize=1) 132 133 else:

C:\Program Files\Anaconda3\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds) 945 c2pread, c2pwrite, 946 errread, errwrite, --> 947 restore_signals, start_new_session) 948 except: 949 # Cleanup if the child failed starting.

C:\Program Files\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session) 1222 env, 1223 cwd, -> 1224 startupinfo) 1225 finally: 1226 # Child is launched. Close the parent's copy of those pipe

PermissionError: [WinError 5] Access is denied

nareshshah139 avatar Nov 22 '16 04:11 nareshshah139

@nareshshah139 welcome to the club 😆

silverstone1903 avatar Nov 23 '16 11:11 silverstone1903

I need to find a Windows/MacOS environment to reproduce this error.

Any help would be much appreciated. The problem has to do with this part :+1:

ArdalanM avatar Nov 23 '16 22:11 ArdalanM

I checked how you integrated my suggestion and it turned it you didn't do it at all. For those who are still having difficulties, you can try out my fork (https://github.com/martinkersner/pyLightGBM). It is 14 days old version, but it could help you to solve your problem.

martinkersner avatar Nov 24 '16 00:11 martinkersner

@martinkersner I tried your repo. It still gives the same permission error.

nareshshah139 avatar Nov 24 '16 05:11 nareshshah139

I have same issue both on Win10 and LinuxMint... On mint, I needed to set correctly path for lib: exec_path = '/home/myUsername/LightGBM/lightgbm'

not exec_path = '/home/myUsername/LightGBM' or exec_path = '/home/myUsername/LightGBM/lib_lightgbm.so'

On win10 server I need to run script as admin for some reason and also setting correct exec_path. 'c:/your_path/LightGBM-master/windows/x64/Release/lightgbm'

gugatr0n1c avatar Nov 29 '16 10:11 gugatr0n1c