5 ms·
virtualenv venv —-python=python3.7 touch requirements.txt echo "flask" > requirements.txt source venv/bin/activate pip install -r requirements.txt Done, wh
by jtdev 7y ago
virtualenv venv —-python=python3.7
touch requirements.txt
echo "flask" > requirements.txt
source venv/bin/activate
pip install -r requirements.txt
Done, what’s so difficult about that?
- snypox 7y agoEverything you just wrote basically.
- xenator 7y agoAlso: pip freeze > prod.txt And then on production environment: pip install -r prod.txt
- icebraining 7y agoPipenv uses hashes to make sure the files are really the same, not just packages with the same version number.
- xenator 7y agoI agree that mostly hashes do their job. The same time I think there is some corner cases. As nature of the python packages can be a bit different comparing to the other packaging systems. File setup.py actually is python file and it is executed when processes. So, it possible that depending on existence of some libraries on your system you will get very different results. For example packages can require very different dependency if you build on Windows or Linux. This case hashes can't do much to guaranty consistency.
- icebraining 7y agoHow do I declare packages needed for development/testing but not production? Yes, pipenv is mostly just a frontend to pip+venv, but that doesn't mean it isn't useful.
- shdh 7y agorequirements-test.txt requirements-dev.txt pip install -r dev.txt
- icebraining 7y agoBut then you can't "pip freeze" to get specific versions for production deployment.