FreeTAKTeam / FreeTakServer

Situational Awareness Server compatible with TAK clients
Eclipse Public License 2.0
649 stars 166 forks source link

windows install - ModuleNotFound Error when running 'flask' #169

Closed b1uebu11 closed 2 years ago

b1uebu11 commented 3 years ago

Wrote this up on stackoverflow - attempted a re-install, still seeing the same error.

^This question on stackoverflow has since closed


Below is what I wrote up on the issue I'm experiencing, still.

I am using this guide to build a FreeTAKServer on a windows machine with Python3. When running this code:

set FLASK_APP=run.py flask run I receive this result and the server won't run:

Error: While importing "FreeTAKServer-UI.run", an ImportError was raised:

Traceback (most recent call last): File "c:\software\python\lib\site-packages\flask\cli.py", line 240, in locate_app import(module_name) File "C:\Software\python\Lib\site-packages\FreeTAKServer-UI\run.py", line 38, in from config import config_dict ModuleNotFoundError: No module named 'config'


I've attached screengrabs below of;

  1. cli.py - line 240
  2. desired result example
  3. flask debug results
  4. run.py - line 38
  5. what I originally posted on stackoverflow

cli py_line 240 desired result - flask run flask debug run py_line 38 stackoverflow - flask run question - now closed - FTS

brothercorvo commented 3 years ago

use pip to install Flask. Laso follow the docs for windows https://freetakteam.github.io/FreeTAKServer-User-Docs/Installation/Windows/FreeTAKServer_Windows_Install.html

b1uebu11 commented 3 years ago

Hey @borthercorvo, I installed Flask using pip as per the instructions in the guide, however I still can't successfully run the UI. Since my question on stackoverflow was auto-closed, I've edited my original comment above to dump what I raised on stackoverflow.

I'm no programmer or pro at this so I'll appreciate if I've done something 'day 1' like.

Any thoughts?

Cheers

Cale-Torino commented 3 years ago

@b1uebu11 It looks like the server is running fine but your UI has a problem.

I had this problem before... follow this to quick fix:

try run in F:\python\Lib\site-packages\FreeTAKServer-UI\app folder

delete ini.py 0kb file in F:\python\Lib\site-packages\FreeTAKServer-UI

then try run in F:\python\Lib\site-packages\FreeTAKServer-UI folder

pip install requests

Afterwards try run the UI again.

b1uebu11 commented 3 years ago

Hey @Cale-Torino, I followed your steps, got it running! However, now I'm receiving an internal server error haha, does this mean I have a break in the connection to the database?

Posted results when hitting the localhost from a browser below:

Error log when accessing localhost.txt

ElSteveGrande commented 3 years ago

I had the same thing happen. When I uncommented

SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:'

Things started "working" but the pages were very slow to load and it didn't seem like it was working (although it was not spitting errors anymore).