
Ask HN: Proper way to set up Python dev environment on Ubuntu? - young_unixer
Do you use venv, virtualenv, virtualenvwrapper, or pipenv?<p>Do you install pip from the Ubuntu repos or from &quot;https:&#x2F;&#x2F;bootstrap.pypa.io&#x2F;get-pip.py&quot; ?<p>Every time I try to set up a Python environment I end up installing pip in 4 different ways and I don&#x27;t know which version to use and it&#x27;s a whole mess.
======
ddavis
I'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)

------
sigjuice
It 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.

------
dhruvkar
\- pyenv

\- pyenv-virtualenv

\- poetry

This is for macOS, but it seems pretty straightforward. I
[https://duncanleung.com/set-up-python-pyenv-virtualenv-
poetr...](https://duncanleung.com/set-up-python-pyenv-virtualenv-poetry/)

------
Maha-pudma
Can 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
I 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).

------
wwarner
Docker will save you a lot of headaches
[https://hub.docker.com/_/python](https://hub.docker.com/_/python)

------
ralston3
Python3.8 , then use virtual envs with “python -m venv ...”

------
minhoryang
anyenv + pyenv + pyenv-virtaulenv + poetry

------
scott31
This 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

~~~
tcbasche
Ah yes, Rust - that easy-to-learn world-renowned language for data science,
machine learning and web dev.

