3 ms·
I am new to Python world but is there any reason one must be necessarily using "virtualenv" on production server? If I am not wrong, its purpose is to avoid con
by shubhamjain 11y ago
I am new to Python world but is there any reason one must be necessarily using "virtualenv" on production server? If I am not wrong, its purpose is to avoid conflicting dependencies but on the deployment server it can be assumed that only one project will be deployed, so I don't believe there can be many instances on conflicting dependencies.
- mkesper 11y agoHe's pushing new versions to that server while running the old stuff. The dependencies could have changed in between.
- est 11y ago> is there any reason one must be necessarily using "virtualenv" on production server? For a single project running on a single server without many updates, you don't need virtualenv. For multiple projects with various age running on multiple different distros and you have dev/staging/prod you might need virtualenv badly.
- fotcorn 11y agoYou need root to install python packages globally. It's always a good idea to deploy without requiring root permissions, for example using sudo with only nginx/gunicorn reload commands allowed.
- riquito 11y agoIt's not a strictly Python problem. He's deploying new code with updated dependencies in a separate directory, while the original site is running. If you manage globally the dependencies you would probably brake the running version of the site during deploy, because it may expects different (old) API from his dependencies. For example the new code may NOT require a previously used dependency, and thus the deploy would remove it and the running code would collapse. Also, if the deploy fail midway you'd like the global environment to be unaffected.