5 ms·
Ask HN: Proper way to set up Python dev environment on Ubuntu?
Do you use venv, virtualenv, virtualenvwrapper, or pipenv?
Do you install pip from the Ubuntu repos or from "https://bootstrap.pypa.io/get-pip.py" ?
Every time I try to set up a Python environment I end up installing pip in 4 different ways and I don't know which version to use and it's a whole mess.
- sigjuice 6y agoIt depends on how sophisticated your needs are. I mostly run python programs of my own on a single computer. I tell the distribution-provided pip to install an upgraded pip separately (pip3 install --user -U). I install everything using pip3 install --user and under no circumstances run any pip commands as root. So far, I have not needed foo-env or docker.
- scott31 6y agoThis is my python setup for ubunut: sudo apt remove python3 sudo apt install python2 curl https://sh.rustup.rs -sSf | sh # Just in case you want to switch to rust later
- ddavis 6y agoI'm a big fan of pyenv [1] with the pyenv-virtualenv extension [2]. The combination makes handling virtual environments with different Python versions incredibly easy. [1] https://github.com/pyenv/pyenv https://github.com/pyenv/pyenv [2] https://github.com/pyenv/pyenv-virtualenv https://github.com/pyenv/pyenv-virtualenv
- wwarner 6y agoDocker will save you a lot of headaches https://hub.docker.com/_/python https://hub.docker.com/_/python
- dhruvkar 6y ago- pyenv - pyenv-virtualenv - poetry This is for macOS, but it seems pretty straightforward. I https://duncanleung.com/set-up-python-pyenv-virtualenv-poetry/ https://duncanleung.com/set-up-python-pyenv-virtualenv-poetr...
- minhoryang 6y agoanyenv + pyenv + pyenv-virtaulenv + poetry
- ralston3 6y agoPython3.8 , then use virtual envs with “python -m venv ...”
- Maha-pudma 6y agoCan I take in from the answers here that no one uses anaconda? I'm only a beginner and that is what I was told to use. It has environments too. Should I be using something else?
- tcbasche 6y agoI think anaconda is mostly used in the data science community, so if that's the kind of work you'll be doing it's great for that (notebooks and such). For everything else I think virtualenv is fine, bit unintuitive but fit for purpose (more or less).