#StackBounty: #python-3.x #deployment #virtualenv Best practice of python virtual environment deployment

Bounty: 50

Sorry if this was answered in another post.

I am very new to python and learning about the virtual environment. I understand that I am supposed to have all the libraries installed in the virtual environment and create the requirement.txt, so others can install using that. However, I am not sure what the best practice to deploy to production?

The reason I ask is that no one supposes to have access to the production environment, the deployment is through a predefined pipeline, and my understanding is that it will zip all my code and deploy it to production, no one suppose to go into production to do any manual work. I can try to get the pipeline to run a script to install all the libraries base on the requirement.txt, but I am not sure if the firewall setting is the same. Should I package the libraries as well?

also, how should I trigger the python script? should I have a wrapper script to activate the vevn before calling python script and deactivate it after? or there is a easier way?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.