r/Python • • Dec 18 '18

Python Virtual Environments: Extreme Advertising Edition

Post image
2.1k Upvotes

287 comments sorted by

View all comments

4

u/lungdart Dec 19 '18

Maybe it's because I'm an old c++ dev who's only been coding in Python for a few years, but virtual environments are a solution to a problem I've never had.

What the hell are you guys doing to get into these dependency hells?!

4

u/JoseALerma Dec 19 '18

At one point, I was working on 4 different python projects at once. Some of them were using APIs that, for example, used different versions of requests, so having venvs helped keep them separate.

Another is when I build documentation with sphinx. I keep a separate venv for the docs so that no extra packages are installed to the main project

1

u/lungdart Dec 19 '18

Why didn't you consolidate and update all versions of requests?

3

u/root45 Dec 19 '18

Because of breaking changes.

0

u/lungdart Dec 19 '18

Again, been programming for over 10 years, and have never had that issue. What braking changes could prevent you from updating a dependency in your api code?

2

u/root45 Dec 19 '18

All kinds of things. E.g., pandas releases often have a couple dozen breaking changes. In a large, pandas-heavy codebase, upgrading pandas could be a huge update that might introduce lots of subtle bugs. It'd be something you'd want to test heavily before releasing.

0

u/lungdart Dec 19 '18

But wouldn't you need to be running two pandas heavy large code bases side by side in the same environment with wildly different versions?

Is this normal for people?

→ More replies (3)