8 ms·
Can I use pip to just install the dependencies without packaging my project as a module? I understand that pip installs "my module" to site packages or a direct
by pacemkr 15y ago
Can I use pip to just install the dependencies without packaging my project as a module? I understand that pip installs "my module" to site packages or a directory under virtualenv. This is not what I need. I don't have a "my module" to install. I just need to make sure that the dependencies are installed on the machine/virtualenv that I'm using for development.
I studied the requirement file documentation and I couldn't find a solution. It seems that to take advantage of this feature in pip I have to write a setup.py, and as I've mentioned that really doesn't make sense for my type of project. Or am I misunderstanding something?
- X-Istence 15y agopip freeze > requirements.txt pip install -f requirements.txt Now whenever you go to develop, pip install -f requirements.txt, when you update dependent packages, pip freeze. You are by no means required to make your source code a module or anything like that. If you use the above with a virtualenv you can isolate different models for different projects and have them frozen at different versions. You are also able to modify requirements.txt to include version specific information. packagename==3.4.0 now locks packagename to 3.4.0 when pip goes to install it. I'm assuming your git directory looks like this: $DIR \ | - requirements.txt | - fileone.py | - filetwo.py | - folder \ | - __init__.py | - filethree.py I have several projects set up exactly like that, especially since they will never have to be distributed using a .egg or anything else.