I am trying to deploy my Django application to a Linux Web App server on Azure. For this to work properly I need to be using Python 3.8 and install all the required modules listed in the requirements.txt file that is located in the wwwroot directory after deployment. I am attempting to setup my virtual environment via the following (from my azure-pipelines.yml file):
- bash: | python3.8 -m venv worker_venv source worker_venv/bin/activate pip3.8 install setuptools pip3.8 install --target="./.python_packages/lib/site-packages" -r requirements.txt workingDirectory: $(projectRoot) displayName: "Install requirements"
I know, from checking in the Kudu debug console, that the dependancies all get installed to /home/.local/lib/python2.7/site-packages rather than the virtual environment's directory for them, /home/site/wwwroot/worker_venv/lib/python3.8/site-packages. Also, by checking 'python --version' I know I am running python 2.7 rather than 3.8 as specified by the venv.
I am thinking the issue is that the 'source worker_venv/bin/activate' line is not activating the venv and therefore I am stuck with Python 2.7. This will not do as my project requires 3.8.
Thank you for any assistance. Please let me know if there is any additional information I can provide.