I have created a flask app which I later deploy on Azure App services to get the endpoint /predict
First was to config the flask
- creates a folder called template
Flask uses a templating engine called Jinja2 which requires that all HTML or template files be stored in a folder called "templates" in the same directory as your Flask app
since I am using jsx files , I needed to configure Flask to use that extension by adding the following line to flaskapp.py file:
app = Flask(__name__)
jsglue = JSGlue(app)
# Add the JSX extension to Flask's Jinja environment
app.jinja_env.add_extension('pyxl.jinja.PyXLExtension')
app.jinja_env.add_extension('pyxl_jinja.JSXExtension')
This line of code adds support for the PyXL templating language, which uses the ".pyx" file extension.
In the terminal I installpip install --upgrade jinja2
-When running the requirement.txt
This is the error I am getting
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for numpy
Building wheel for pandas (pyproject.toml) ... done
Created wheel for pandas: filename=pandas-1.2.2-cp310-cp310-macosx_11_0_arm64.whl size=9124426 sha256=2fde57edca2ad375170f5b1dd3152a55d3fcf12fe10e4f1fbd7f42897a86ea80
Stored in directory: /Users/keziawangeciwahome/Library/Caches/pip/wheels/3e/5e/23/95e1e24bfc72728eea4bc557c040684b7c1af623b37fdbf7be
Building wheel for scikit-learn (pyproject.toml) ... done
Created wheel for scikit-learn: filename=scikit_learn-0.24.1-cp310-cp310-macosx_12_0_arm64.whl size=6352154 sha256=242e1a12bb6f7602d3125fa5244ce73c5bf781561d50764760b5efb1b2390afa
Stored in directory: /Users/keziawangeciwahome/Library/Caches/pip/wheels/7a/5d/32/f4299815f5e059746d9535998da45ed806ef87421d565c47d3
Successfully built pandas scikit-learn
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
This is because I had installed numpy before pip show numpy
Also need to install pip install -U scikit-learn
which is used to unpickle the model
to get ride of this error , I will deploy the model as an app , flaskapp instead of integrating it with the react app