Reputation: 98
i've been looking for answers in stackoverflow and over all the web but still don't get it, i started a new project and upload it to a repository in github, all this i did it from a MAC computer, everything fine until here, but... i tried cloning my project in an Windows computer and i can not activate my venv, to activate the venv in MAC there is a bin file, so i type the following commands in the terminal, 'source bin/activate' and it works fine, but i understand that in windows there is a Script folder which i dont have because i created and activated my project for the first time in MAC, there is a way which is deleting the venv directory everytime i clone my project in a different OS but i dont think that's a good pratice, so i would like to know which is the correct way of doing this, which are your recommendations? Thanks.
Upvotes: 0
Views: 597
Reputation: 478
A virtual environment still has references back to the host machine's python installation. Since Macs and PCs have different locations for where python is located/installed, besides the fact that a virtualenv is much different on a PC than on a Mac (even though they accomplish the same task), a virtualenv created on a Mac will not work out of the box if you transfer the files to a PC.
I recommend adding your virtualenv's folder to your gitignore, then just creating separate environments on your Mac and PC.
Upvotes: 1