Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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. Is there any reason why I shouldn't do this?

like image 286
Lyle Pratt Avatar asked Jul 06 '11 01:07

Lyle Pratt


People also ask

Should you include virtual environment in git?

In order to get the simplest dependency requirements file, you'd better use a virtualenv for all the development. But the directories created by virtualenv, e.g., bin , lib , src , are better not to put into git repos and not to write into .

Where should virtualenv be installed?

The new package should get installed in the virtual environment folder. Check the virtual environment folder inside lib64/python3.

Should you upload virtual environment to github?

No Its not necessary to upload virtualenv file on github. and even some time when you push your code to github then it ignore python file only if add into ignore.

Can I move a virtualenv folder to another computer?

Yes, this should be possible if you haven't done anything that depends on the current directory of the virtualenv. However, if you have the choice, the best thing to do is to create new virtualenv and start using the new virtualenv instead.


1 Answers

I use pip freeze to get the packages I need into a requirements.txt file and add that to my repository. I tried to think of a way of why you would want to store the entire virtualenv, but I could not.

like image 76
RyanBrady Avatar answered Oct 22 '22 14:10

RyanBrady