I’m developing a web-app and the work needs to be done from two computers, one is running Linux the other is running Windows.
This app is developed with Pyramid framework on Python 2.6.7 (this is what the server runs, and I can’t change it)
Following the tutorials in Pyramid site, I’ve created a virtualenv on the Linux machine, and created a project – tested it and it seems to run without issues on the Linux machine. Now in order to sync the work to Windows, I thought of using git (with a free private projcet from bitbucket). I created a git project and pushed it to bitbucket. I used this .gitignore file template and I’ve also added this line (I believe that venv is OS specific, but I could be wrong):
venv
After I cloned the project to Windows, I don’t have a virtualenv – How do I create a venv that would be compatible with the one that exists on the Linux machine (my Windows machine has Python 2.7 installed on it, no sqlalchemy, etc.)? What is the ‘correct’ way of doing it? Should I just give app (it was a spelling mistake, but I’ll leave it for now) Windows and use Ubuntu on a virtualbox?
EDIT:
Although I have already accepted Rostyslav Dzinko’s answer regarding the use of a requirements.txt file, the right way is to actually use the built in setup.py that is generated by pyramid’s scaffold mechanism during the pcreate process. So if anyone encounter this issue please consider trying:
python setup.py develop
Virtualenv creates virtual environment for your Python interpreter. It means that each virtual environment can have different versions of same packages installed or different packages at all that are important only for your project (dependencies).
If you want to manage dependencies, you can use pip to make your new virtual environment synchronized with old one.
All you need to do is to create requirements.txt file and fill it with dependencies, e.g:
Let this file be in your git repository.
After cloning the source into newly created virtualenv on a new machine, you can install all dependencies with pip: