yes I know my question sounds like a duplicate but I have tried everything I have found.
I am trying to add a module to my python flask app. This module is located at ../../clients/api
relative to my flask app. I haven't had any problems adding a module before, but for some reason this just doesn't want to work.
So far, I have tried:
sys.path.append("mypath")
(worked temporarily but as soon as the shell was closed it disappeared)- adding a
.pth
file inlib/site-packages
- adding it directly to my environment variables
- adding in in my IDE (Wing 101)
Aside from 1., none of them had any effect whatsoever.
$ flask run
* Serving Flask app "main.py"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: While importing "main", an ImportError was raised:
Traceback (most recent call last):
File "c:\python37-32\lib\site-packages\flask\cli.py", line 235, in locate_app
__import__(module_name)
File "my_flask_app_path", line 20, in <module>
from clients.api import Client as client
ModuleNotFoundError: No module named 'api'
Running this on python v-3.7.1, Windows 10, both git bash and cmd. Please try not to be blunt :)