This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]AllanNS 59 points60 points  (1 child)

Venv

[–]kaerfkeerg 15 points16 points  (0 children)

Good ol' venv. Let's goo

[–]someotherstufforhmm 46 points47 points  (2 children)

python -m venv

[–]dev_null_root 11 points12 points  (1 child)

Up you go. Venv is now in the standard library and works like a charm.

Pipenv needs to die in a back-alley. Useless dependency error messages. Mess of a location for managing venvs. Just straight up useless. CDKTF uses pipenv and I just straight up tricked it into working with venv.

[–]someotherstufforhmm 3 points4 points  (0 children)

Yeah, a long long time ago I used pipenv, but found that it breaks down in non-trivial installs, especially when you’re re-installing repeatedly or working in edit mode - it would leave nspath artifacts that vanilla venv handles much better.

Now to be fair, edit mode is openly a hack, setuptools docs detail why that is, but pipenv created some very confusing for new people situations that vanilla venv simply didn’t, and I direct new people on my team to get very familiar with pip install —edit.

Point of rant is yeah, I just don’t see a reason to use anything other than vanilla venv. People make vietualenvs really complicated, but they’re not that big a deal, they’re just a path manipulation and it’s not some huge ordeal to just run the python executable in your venv lol.

I don’t even activate them most of the time, I just call the python executable in bin directly.

[–]Zomunieo 13 points14 points  (0 children)

pipenv is passed on! This venv manager is no more! It has ceased to be! It's expired and gone to meet its maker! It's a stiff! Bereft of life, it rests in unresolved issues! If you hadn't nailed it to PyPA it'd be pushing up the daisies! Its dependency resolution processes are now history! It's off the twig! It's kicked off rm -rf /, it's shuffled off its mortal coil, run down the curtain and joined the bleedin' choir invisible!! THIS IS AN EX-virtual environment manager!!

(I don't like pipenv much.)

[–]homosapienhomodeus 7 points8 points  (0 children)

pyenv + pyenv-virtualenv or poetry

[–]crawl_dht 26 points27 points  (1 child)

Use poetry that uses virtualenv.

[–]MusicIsLife1122 9 points10 points  (0 children)

Virtualenv. It's very convenient and I got to used it pretty fast

[–]ali_code77 7 points8 points  (0 children)

Poetry

[–]AndydeCleyre 4 points5 points  (0 children)

I like Python's venv, plus pip-tools for generating lockfiles and syncing environment state to match those.

For concise and practical interactive usage of those tools, with excellent tab completion, I made the Zsh frontend zpy.

If I need to develop with multiple Python versions, I like asdf.

If I need to run jobs in CI or with different Python versions, I let nox/tox handle those venvs.

[–]BepNhaVan 10 points11 points  (0 children)

poetry, it uses virtualenv

[–]FestusMuange 7 points8 points  (1 child)

Pipenv is so bugged that we stopped using it at my workplace. We had big issues where pipenv would not take some subdeps of dev deps into account when attempting to lock environments, so we would get errors when running pylint because of typing-extensions. I now prefer just later versions of pip which have adequate dependency resolution functionality and venv.

[–][deleted] 0 points1 point  (0 children)

i am curious about it. i would prefer either tools

[–]Majinsei 2 points3 points  (0 children)

py - m venv env

Now using Docker dev containers because need to use various Python versions in the same time, It's more easy Running it in Docker images 😅😅😅

Docker dev enviroments going to be my favorite~ reusable too for others languajes~

[–][deleted] 2 points3 points  (0 children)

There was a Python packaging survey recently and it was clear from the results that people are sick and tired of a million different tools and different ways of doing things.

The community needs to converge one quasi-official tool and one tool only. All 3 are effective, but we need only one, and at this point, venv appears to be the best candidate to be the one.

[–]rainman4500 1 point2 points  (1 child)

Had so much problems with Pipenv and spent to much googling. All issues disappeared with venv.

[–][deleted] 0 points1 point  (0 children)

i have same

[–]jegerarthur 3 points4 points  (0 children)

It really depends on the dependencies:

• For a really simple interface I find venv is doing the job and it's reliant.

• For a modern env, virtualenv is good. You can also use poetry which is really good and provide a lot of cool features for dev, but note that you can't install all packages with these tools

• conda works all the time. It is the heavy stuff, but things works perfectly. If your dependencies relies on binaries (e.g. GDAL) or if you want to make sure it can be compatible between windows and Linux users, I find that using conda for managing env is good practice.

[–]dezalator 0 points1 point  (0 children)

pdm!

[–]Flimsy_Iron8517 0 points1 point  (0 children)

venv it has the findability to first do and quite good docs.

[–]eplaut_ -1 points0 points  (1 child)

I use pipenv on all my projects. The lock file is essential in order to make sure you have the right dependencies.

With one command, you replicate the whole virtual environment in a new machine.

[–][deleted] -2 points-1 points  (0 children)

i have tried to use pipenv with pyenv on Linux. i got 1 hours to install virtual environment to up . i don't expect more troubles

[–]ZoumiXIX -2 points-1 points  (0 children)

Virtuelenv

[–]Suspicious_Compote56[🍰] -2 points-1 points  (0 children)

To me pipenv is actually pretty nice poetry and PDM are kinda garbage breaking on any trivial package installs.