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

uupdate the call to "flask" #12

Open
BDonnot opened this issue Apr 15, 2020 · 1 comment
Open

uupdate the call to "flask" #12

BDonnot opened this issue Apr 15, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@BDonnot
Copy link
Contributor

BDonnot commented Apr 15, 2020

Hello, in the "main" file the command "flask" is called, but on some machine, especially when working on a computer where the python package is installed in the "user" environment, and not globally (because you don't have proper access rights for example) the command "flask" might not be found, though the "flask" package is installed properly. This will lead to this error:

/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'grid2viz.main' found in sys.modules after import of package 'grid2viz', but prior to execution of 'grid2viz.main'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
INFO Using the default provided environment
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/benjamin/.local/lib/python3.6/site-packages/grid2viz/main.py", line 56, in <module>
    main(args)
  File "/home/benjamin/.local/lib/python3.6/site-packages/grid2viz/main.py", line 43, in main
    proc = subprocess.Popen(my_cmd, env=my_env)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'flask': 'flask'

To fix that, i think updating the call to "sys.executable -m flask" instead of simply "flask" will solve this issue.

@mjothy
Copy link
Collaborator

mjothy commented Apr 16, 2020

Hello Benjamin,

It will be difficult for us to test the impact of this change (and see if it fixes your problem).
Maybe the best would be if you could make the change you are suggesting, and see if it fixes your issue ? If it does, we'll integrate it (either via pull request, or simply tell us and we'll commit the changes).

Thanks

@mjothy mjothy added the enhancement New feature or request label Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants