Hacker News new | ask | show | jobs
by mason55 3207 days ago
How do you manage dependencies? One of the best parts about virtualenv (to me at least) is that I can do pip install without infecting the rest of the system.

I guess I've never looked, does virtualenv provides a bin/pip which already knows the path of the virtualenv? Does the bin/python in there come with a path that uses the project pip install?

3 comments

There is a bin/pip you could call directly and have it install packages to the correct path. Even commands installed from packages work that way.

I would only use 'bin/python' directly from scripts called from cron, or other similar places.

./venv/bin/pip install package

Best part is you can't accidentally install a package in the wrong venv this way.

I hate modal systems...

Yes, exactly. bin/pip inside the virtualenv installs into that virtualenv.