Is it bad to have my virtualenv directory inside my git repository?

前端 未结 9 2119
醉话见心
醉话见心 2020-12-04 04:42

I\'m thinking about putting the virtualenv for a Django web app I am making inside my git repository for the app. It seems like an easy way to keep deploy\'s simple and easy

9条回答
  •  情歌与酒
    2020-12-04 05:20

    I think one of the main problems which occur is that the virtualenv might not be usable by other people. Reason is that it always uses absolute paths. So if you virtualenv was for example in /home/lyle/myenv/ it will assume the same for all other people using this repository (it must be exactly the same absolute path). You can't presume people using the same directory structure as you.

    Better practice is that everybody is setting up their own environment (be it with or without virtualenv) and installing libraries there. That also makes you code more usable over different platforms (Linux/Windows/Mac), also because virtualenv is installed different in each of them.

提交回复
热议问题