Some time ago I started developing an application. According to numerous tips, the development is carried out in a virtual environment, which made me think about the question - how will the finished application be deployed on target machines? Do I need to package the application + dependent packages, or transfer the package itself + requirements.txt? Venv not used in production? What is then the advantage of venv? Why not just install dependencies into the system during development?
Closed due to the fact that the issue is too general for participants jfs , aleksandr barakin , fori1ton , Nick Volynkin ♦ 26 Apr '16 at 4:56 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
1 answer
Firstly, venv is often used in production, including even on low-cost hosting, and on a dedicated server, no one will interfere with its use.
And how to deploy applications is a vast topic. Someone is using docker containers or something like that. In the simplest case, the package + requirements.txt is enough, because there you can specify the versions of libraries you need.
venv is good because you can make your environment for each project. Otherwise, when switching from project to project, you would need to reinstall the libraries of the required versions.
pip install(for Python programmers),git push,curl https://.../install.sh | shcurl https://.../install.sh | sh(for adventurers), system packages (eg, fpm, ppa on Ubuntu), docker containers, Fabric, Salt, Ansible, etc. etc. Specify your question: what kind of application, who is the user, what specific requirements. - jfs