Unable to install pip on suse

watchingdogs picture watchingdogs · Apr 23, 2015 · Viewed 8.6k times · Source

Pretty new to linux/suse and python so excuse me if I cause some simple questions. I've search through stackoverflow and haven't gotten a result for my question.

I'm running on Windows with a Virtual machine using SUSE. I'm trying to install py.test, but to install it, it needs either pip or easy_install. I've heard pip is preferred over easy_install, so I tried installing that with get-pip.py.

I run it with

python get-pip.py

and it tells me it has been installed, this is what it ouputs

Collecting pip
Using cached pip-6.1.1-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-15.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools
Successfully installed pip-6.1.1 setuptools-15.1

I tried running

pip install -U pytest

however the command pip has not been found. I also looked into python-pip package via openSUSE, though I'm not sure how to open a .ymp file through a VM.

Would I have to add a path for it to work? Pointers would be appreciated.

Answer

Dan Cornilescu picture Dan Cornilescu · Apr 24, 2015

It looks like pip was unstalled by a regular user, so it was installed under the user's homedir, thus needs to be explicitly added to the path.

On openSUSE I'd suggest installing it using YaST (as root) and it'll end up in /usr/bin/pip, shareable by all users. Here's how it looks like on openSUSE 13.2:

$> which pip
/usr/bin/pip
$> rpm -qf /usr/bin/pip
python3-pip-1.5.6-2.1.3.noarch

Just search for pip in the software management tool.

Also many additional python packages/modules come prepackaged as openSUSE RPMs, better check the software management tool 1st.