Bug ID 1071941
Summary pip installs packages in /usr/lib instead of /usr/local/lib
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Basesystem
Assignee bnc-team-screening@forge.provo.novell.com
Reporter markos.chandras@suse.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

Hello,

/usr/local is meant to be used for packages installed outside of package
manager. Such case is 'pip' in which you can install additional python
packages. The problem is that openSUSE pip is installing packages in /usr/lib
which overrides python packages installed by zypper

For example consider the python2-hpack installed using zypper

python2-hpack-3.0.0-1.1.noarch it is installed in 

/usr/lib/python2.7/site-packages/hpack
/usr/lib/python2.7/site-packages/hpack-3.0.0-py2.7.egg-info
/usr/lib/python2.7/site-packages/hpack-3.0.0-py2.7.egg-info/PKG-INFO
...
etc

now installing hpack from pip results to

> pip2.7 install -I hpack
> pip2.7 show hpack|grep Location
Location: /usr/lib/python2.7/site-packages

As you can see, pip puts the wheel package into the same location that zypper
installed it which effectively overwrites it. Consider also the opposite
situation where you first install from pip and then from zypper. zypper will
overwrite what you had installed from pip. This is quite problematic when you
want zypper and pip packages to happily co-exist for development and testing
purposes.

This behavior is different compared to other distros where they put pip
packages in /usr/local in order to keep them separate from the python packages
installed by the package manager.

For example, here is the same package on Ubuntu Xenial installed with apt-get

$ dpkg -L python-hpack
/.
/usr
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/hpack-2.1.0.egg-info
...
etc

and the one installed by pip

> sudo pip2.7 install -I hpack
> sudo pip2.7 show hpack|grep Location
Location: /usr/local/lib/python2.7/dist-packages

As you see both packages can exist on the same system. CentOS also puts pip
packages in /usr/local.


You are receiving this mail because: