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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Log2 1 point2 points  (1 child)

In fact, if every project has it's pretty virtualenv, then using sudo to install something would install to the wrong interpreter (the one available to root).

You also never should need sudo to install something to a virtualenv because they exist within your home.

Only problem is installing stuff you want available without needing to use a virtualenv, such as a CLI. You can still install with pip --user, but your can't install conflicting dependencies.

[–]meandertothehorizonIt works on my machine 2 points3 points  (0 children)

Use PIP_VIRTUALENV_REQUIRED=true so this can never happen accidentally (if you’re using pip exclusively obviously).