jerry-git / learn-python3

Jupyter notebooks for teaching/learning Python 3
MIT License
6.43k stars 1.77k forks source link

My question: environments! #5

Closed patmoore closed 5 years ago

patmoore commented 6 years ago

virtualenv, pip, easy_install, ??? What is the idiomatic package manager development environment that is best from a enterprise developer perspective! I would contribute an answer if I knew it.

jerry-git commented 6 years ago

Thanks for the question!

I'd say pipenv is the way to go for the majority of the use cases, especially if you're developing deployable applications. However, if you're developing e.g. libraries which have to support multiple different Python versions, pipenv is not necessarily the best option. From the pipenv docs:

Ideally, you should only have one target Python version, as this is a deployment tool.

If pipenv seems not to be suitable for your needs, I recommend checking out virtualenvwrapper, using requirements.txt file for listing dependencies, and using pip for installing the dependencies.

Considering the materials in this repo, I'll refactor the virtual environments notebook to cover pipenv. Now that it's mentioned here, it's officially on my todo list 😃

jerry-git commented 5 years ago

This is now better explained in best practices, see: https://jerry-git.github.io/learn-python3/notebooks/intermediate/html/best_practices.html#One-virtual-environment-per-project