coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
794 stars 138 forks source link

Command line utilities don't work out of the box on Windows 10 #46

Closed austinkeller closed 7 years ago

austinkeller commented 7 years ago

When trying to run from the command line the myfitnesspal script fails when trying to load _curses:

(py2) C:\Users\austi>myfitnesspal
Traceback (most recent call last):
  File "c:\users\austi\anaconda2\envs\py2\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\users\austi\anaconda2\envs\py2\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\austi\Anaconda2\envs\py2\Scripts\myfitnesspal.exe\__main__.py", line 5, in <module>
  File "c:\users\austi\anaconda2\envs\py2\lib\site-packages\myfitnesspal\cmdline.py", line 6, in <module>
    from .commands import COMMANDS, get_command_list
  File "c:\users\austi\anaconda2\envs\py2\lib\site-packages\myfitnesspal\commands.py", line 8, in <module>
    from blessed import Terminal
  File "c:\users\austi\anaconda2\envs\py2\lib\site-packages\blessed\__init__.py", line 10, in <module>
    from blessed.terminal import Terminal
  File "c:\users\austi\anaconda2\envs\py2\lib\site-packages\blessed\terminal.py", line 8, in <module>
    import curses
  File "c:\users\austi\anaconda2\envs\py2\lib\curses\__init__.py", line 15, in <module>
    from _curses import *
ImportError: No module named _curses

I've attached my conda environment to help reproduce the issue.

atkeller_env.yaml.txt

coddingtonbear commented 7 years ago

Unfortunately, that's a limitation of a library python-myfitnesspal relies upon (blessed) on Windows -- the curses library isn't supported there. Given that the problem is rooted in a dependent library, I'm afraid the best options I can suggest are:

Note that this does not prevent you from using the library itself -- only its command-line interface.

I wish I had better options for you, but although windows has improved quite a lot over the last few years, it's terminal is still not capable of many things that those of us on linux/osx take for granted.

Good luck, @austinkeller; cheers!