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

automatic_sleep_staging: No module named 'lightbgm' #28

Closed
18alia opened this issue Jan 29, 2021 · 3 comments
Closed

automatic_sleep_staging: No module named 'lightbgm' #28

18alia opened this issue Jan 29, 2021 · 3 comments
Labels
question 🙋 Further information is requested

Comments

@18alia
Copy link

18alia commented Jan 29, 2021

When I tried running the 5th code block in the notebook 14_automatic_sleep_staging, I got the error: ModuleNotFoundError: No module named 'lightgbm'
Here is my traceback:
ModuleNotFoundError Traceback (most recent call last)
in
1 # Getting the predicted sleep stages is now as easy as:
----> 2 y_pred = sls.predict()
3 y_pred

~\PyMOL\lib\site-packages\yasa\staging.py in predict(self, path_to_model)
425 self.fit()
426 # Load and validate pre-trained classifier
--> 427 clf = self._load_model(path_to_model)
428 # Now we make sure that the features are aligned
429 X = self.features.copy()[clf.feature_name]

~\PyMOL\lib\site-packages\yasa\staging.py in _load_model(self, path_to_model)
398 assert os.path.isfile(path_to_model), "File does not exist."
399 # Load using Joblib
--> 400 clf = joblib.load(path_to_model)
401 # Validate features
402 self._validate_predict(clf)

~\PyMOL\lib\site-packages\joblib\numpy_pickle.py in load(filename, mmap_mode)
583 return load_compatibility(fobj)
584
--> 585 obj = _unpickle(fobj, filename, mmap_mode)
586 return obj

~\PyMOL\lib\site-packages\joblib\numpy_pickle.py in _unpickle(fobj, filename, mmap_mode)
502 obj = None
503 try:
--> 504 obj = unpickler.load()
505 if unpickler.compat_mode:
506 warnings.warn("The file '%s' has been generated with a "

~\PyMOL\lib\pickle.py in load(self)
1086 raise EOFError
1087 assert isinstance(key, bytes_types)
-> 1088 dispatchkey[0]
1089 except _Stop as stopinst:
1090 return stopinst.value

~\PyMOL\lib\pickle.py in load_stack_global(self)
1383 if type(name) is not str or type(module) is not str:
1384 raise UnpicklingError("STACK_GLOBAL requires str")
-> 1385 self.append(self.find_class(module, name))
1386 dispatch[STACK_GLOBAL[0]] = load_stack_global
1387

~\PyMOL\lib\pickle.py in find_class(self, module, name)
1424 elif module in _compat_pickle.IMPORT_MAPPING:
1425 module = _compat_pickle.IMPORT_MAPPING[module]
-> 1426 import(module, level=0)
1427 if self.proto >= 4:
1428 return _getattribute(sys.modules[module], name)[0]

ModuleNotFoundError: No module named 'lightgbm'

How do I fix this error? Do I need to install something else? I already tried upgrading yasa with the commandpip install --upgrade yasa, and it told me all requirements were already satisfied

@raphaelvallat raphaelvallat added the question 🙋 Further information is requested label Jan 29, 2021
@raphaelvallat
Copy link
Owner

Hi @18alia,

You need to install the lightgbm package: https://lightgbm.readthedocs.io/en/latest/Python-Intro.html

Thanks
Raphael

@18alia
Copy link
Author

18alia commented Feb 1, 2021

Thank you! What else do I need to install to use YASA. I'm assuming I need the things listed on the requirements.txt file, so what is the best way to install all these if I am not GitCloning the entire project?

@raphaelvallat
Copy link
Owner

Hi @18alia,

You can pip install all of the packages in the requirements.txt file, with the exception of the entropy package that requires a manual install (via git clone / zip download).

Best,
Raphael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question 🙋 Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants