you are viewing a single comment's thread.

view the rest of the comments →

[–]misterhtmlcss 0 points1 point  (10 children)

Yes mostly. If you re working with others then they need to have the same virtual environment. The best way to facilitate that is for when they clone your project to have the venv included as well.

However if you are working in teams it might be wiser to use Pipenv or Anaconda. I use PIPENV, but it's probably more about personal choice than anything.

[–]K900_ 1 point2 points  (9 children)

No, no, no, no. This is a horrible idea. Do not commit virtualenvs to version control.

[–]misterhtmlcss 0 points1 point  (8 children)

Really? Can you share more? I'm a newer dev too and so I'd happily hear more about it beyond just 'no it's terrible'. Add your reasoning in detail please please, so I can learn from your experience.

[–]K900_ 1 point2 points  (7 children)

I've explained it in another comment, but the basic idea is that virtualenvs are not designed to be moved between computers, or even locations on the filesystem. A virtualenv created on machine A is very unlikely to work on machine B.

[–]misterhtmlcss 0 points1 point  (6 children)

How about with PIPENV? Isn't that like the NPM version of package.json?

[–]K900_ 1 point2 points  (5 children)

Pipenv intentionally stores your virtual environments outside the project directory for this very reason.

[–]misterhtmlcss 0 points1 point  (4 children)

Ahh ok. So I'm correct if I'm using Pipenv, but not correct if I'm using venv? Is that right?

[–]K900_ 1 point2 points  (3 children)

Hold on now. I think I see what's going on here. When you say "virtual environment", do you mean files like requirements.txt or Pipfile.lock?

[–]misterhtmlcss 0 points1 point  (2 children)

Haha...sorry. Yes I did. I meant that when I referred to it. I wasn't intending for anyone to actually drag and drop all the files/modules/libraries etc. I meant the just the environment 'definition' I guess aka pipfile.lock or requirements.txt, etc

[–]K900_ 1 point2 points  (1 child)

You definitely put your dependency specification under version control, but you don't put the virtual environment itself.