default install path for pip packages

Hi all,
I am new to openSUSE and have question about default install path for python pip packages.

When I install pip packages by performing [FONT=arial][FONT=courier new]pip install xxx[/FONT][/FONT] with root previledge, packages are installed under /usr, not /usr/local.
For example, hg is installed to /usr/bin/hg by performing pip install mercurial
This may cause file conflicts when installing same application via zypper, so I think it would be better that default install path for pip packages are different from packages provided by zypper.
In several other distros such as Debian, default install path for pip packages is /usr/local .

I understand that we can specify default install prefix by configureing /etc/pip.conf, but is there any special reason or background that openSUSE’s pip installs packages under /usr ?


Hi and welcome to the Forum :slight_smile:
Not sure why you want to use pip… many package are available for install esp in Tumbleweed else via the development repositories if you can’t wait for it to appear in the main repository.

zypper if mercurial

Repository     : Main Repository (OSS)   
Name           : mercurial               
Version        : 4.3.1-1.2

Probably like sudo, openSUSE has a tendency to let the user decide and configure what they want to do…

Thanks for the quick response!

When installing apps that is not provided by zypper (such as conan), we will use pip, and pip installs not only sepecified app but also its dependencies. So I worried about the conflicts.

It seems that per user installation (i.e. pip install --user xxx) is preffered…

I’ve never experienced a problem the relatively few times I’ve needed to install something from PyPi,
But you’re right that there is probably some possibility for problems.

Recommend installing virtualenv,
Then “pip” within a virtualenv if you want to be extra careful.

I typically install my Dev projects into custom Dev environments in virtual machines to minimize conflicts and isolate what happens in Dev from any other active (especially other Dev environments).