imns
imns

Reputation: 5082

pip tries to uninstall system packages

I'm using pip on webfaction and it keeps trying to uninstall system packages and then failing. For example if I try to install Fabric, one of the requirements is pycrypto. When it tries to uninstall it, it fails.

Is there anyway to tell pip to not do this?

Upvotes: 0

Views: 218

Answers (2)

Balthazar Rouberol
Balthazar Rouberol

Reputation: 7180

My guess is you have created the virtualenv with the --system-site-packages option, so it could use some packages installed system-wide.

If that's indeed what you did, try to create a clean virtualenv, and install all your dependencies inside it. This way, you'll never have to think of what packages are installed sytem-wide and what packages are installed in the virtualenv.

To do so, you can use --no-site-packages, which has now become a default virtualenv option.

Upvotes: 0

This is a common use scenario for virtualenv (aside from... all the time).

Build your app around a clean virtualenv so that you don't have to think about system packages ever again (mostly) in permission limited environments.

Upvotes: 2

Related Questions