I am trying to understand exactly what Python is doing to import statements and install packages. I really want to know the "path" that python follows to accomplish this so I can try and follow along to see how people who have created well known packages have accomplished it.
I created a venv called FlaskVE in a folder. Directory structure (Windows) as follows:
c:\users\me\documents\FlaskVE
\Include
\Lib
\Scripts
I activated the virtual environment and installed flask using pip
$ cd c:\users\me\documents\FlaskVE\Scripts
$ activate
<-current prompt (FlaskVE) c:\users\me\documents\FlaskVE\Scripts
$ pip install flask
$ python
$ from flask import Flask
At this point, python looks along my PATH for python packages, since I am in a venv, the PATH points to the current folder I am in. Within \FlaskVE\Lib\site-packages\flask there is not a Flask.py folder. How does Python find the Flask class? I can see within the init.py file within \FlaskVE\Lib\site-packages\flask there is a command "from .app import Flask, Request, Response" and within the app.py file in that directory there is a class called Flask. Is this the one it is importing and if so, does the "from flask" call start the init.py file automatically?