ahodges9 / LedFx

LedFx is a network based LED effect controller with support for advanced real-time audio effects! LedFx can control multiple devices and works great with cheap ESP8266 nodes allowing for cost effectvice syncronized effects across your entire house!
MIT License
385 stars 91 forks source link

[windows 10] configuration lost when closing / create a shortcut to activate the env AND executing "ledfx" command #51

Closed sladaar closed 4 years ago

sladaar commented 4 years ago

First of all, thanks a lot for this project, it's awesome!

So, i'm on windows and installed ledfx in Anaconda. To run the visualization i needed a shortcut without entering the environment, so i found the executable in C:\Users\"myuser"\Anaconda3\envs\ledfx\Scripts\ledfx.exe and so far no problems. BUT, when i close the window it seems i lose the configuration file, C:\Users\"myuser"\AppData\Roaming.ledfx\config.yaml or however i can't run the visualization no more because it fires me an error:

Loading` configuration file from C:\Users\mbibox\AppData\Roaming\.ledfx
Traceback (most recent call last):
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\site-packages\voluptuous\schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\site-packages\voluptuous\schema_builder.py", line 553, in validate_dict
    raise er.DictInvalid('expected a dictionary', path)
voluptuous.error.DictInvalid: expected a dictionary

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\mbibox\Anaconda3\envs\ledfx\Scripts\ledfx.exe\__main__.py", line 7, in <module>
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\site-packages\ledfx\__main__.py", line 88, in main
    ledfx = LedFxCore(config_dir = args.config)
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\site-packages\ledfx\core.py", line 23, in __init__
    self.config = load_config(config_dir)
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\site-packages\ledfx\config.py", line 87, in load_config
    return CORE_CONFIG_SCHEMA(yaml.load(file))
  File "c:\users\mbibox\anaconda3\envs\ledfx\lib\site-packages\voluptuous\schema_builder.py", line 271, in __call__
    raise er.MultipleInvalid([e])
voluptuous.error.MultipleInvalid: expected a dictionary`

Thanks in advance!

with further investigations it seems that executing that exe could be the problem, because running the script inside the anaconda environment could resolve the issue. So i'm trying to create a shortcut to activate the env AND execute "ledfx" command.

sladaar commented 4 years ago

did it by myself!

GrandNewbien commented 4 years ago

@sladaar How did you manage to do this?

Hokyjack commented 4 years ago

Make a BAT script containing: call activate ledfx call c:\Users\\Anaconda3\envs\ledfx\Scripts\ledfx.exe

tihoangyeudau commented 3 years ago

@Hokyjack I did it but it did not work.

(base) C:\Users\tuant>call C:\Users\tuant\anaconda3\Scripts\activate.bat ledfx

(ledfx) C:\Users\tuant>call C:\Users\tuant\anaconda3\envs\ledfx\Scripts\ledfx.exe
Loading configuration file from C:\Users\tuant\AppData\Roaming\.ledfx
Loading default presets from C:\Users\tuant\anaconda3\envs\ledfx\Lib\site-packages\ledfx
Traceback (most recent call last):
  File "c:\users\tuant\anaconda3\envs\ledfx\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\tuant\anaconda3\envs\ledfx\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\tuant\anaconda3\envs\ledfx\Scripts\ledfx.exe\__main__.py", line 7, in <module>
  File "c:\users\tuant\anaconda3\envs\ledfx\lib\site-packages\ledfx\__main__.py", line 89, in main
    ledfx.start(open_ui = args.open_ui)
  File "c:\users\tuant\anaconda3\envs\ledfx\lib\site-packages\ledfx\core.py", line 66, in start
    import win32api
ImportError: DLL load failed while importing win32api: The specified module could not be found.
Geraldidi commented 3 years ago

don't know if this is the best way but works for me :) ledfx.bat:

call "C:\Users\admin\anaconda3\Scripts\activate.bat" ledfx & "C:\Users\admin\anaconda3\envs\ledfx\Scripts\ledfx.exe" --open-ui