I am currently running Opensuse 13.2, 64 bit version on my computer. By default, on my system both python3.4 and python2.7 were installed(I am not sure whether they were installed because I "patch"ed it.) Normally when I type “python” on commandline python2.7 gets callled. My problem is when I try to make system-wide installation for python using pip, pip’s default installation path seems to be python3.4/site-packages directory, but I don’t want that. Also when typed “pip list”, it seems that packages within python3.4 directory gets displayed but not packages inside python2.7. Besides that, when I install virtualenv and virtualenvwrapper using pip, it causes some problems. For example, virtualenv uses python3.4 by default when a project gets created. Virtualenvwrapper.sh file within /usr/bin directory returns an error since it looks inside python2.7 directory and cannot find anything, but it is actually installed within python3.4.
My question is how can I change pip’s default installation path?
Although I made a lot searches on the web, I could not find a decent answer.
I think I figured out the problem. easy_install command installs pip to python3.4 directory by default. I also tried using “zypper in python-pip” and had lots of errors.
Here are the errors:
@linux-155p:~> pip
Traceback (most recent call last):
File “/usr/bin/pip”, line 9, in <module>
load_entry_point(‘pip==1.5’, ‘console_scripts’, ‘pip2.7’)()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2190, in load
‘name’])
File “/usr/lib/python2.7/site-packages/pip/init.py”, line 8, in <module>
from pip.exceptions import InstallationError, CommandError, PipError
File “/usr/lib/python2.7/site-packages/pip/pip/init.py”, line 13, in <module>
from pip.utils import get_installed_distributions, get_prog
File “/usr/lib/python2.7/site-packages/pip/utils/init.py”, line 18, in <module>
from pip.locations import (
File “/usr/lib/python2.7/site-packages/pip/locations.py”, line 9, in <module>
from pip.backwardcompat import get_python_lib, get_path_uid, user_site
ImportError: No module named backwardcompat
If this is a completely fresh untouched system with nothing, reinstall, install pip and update-alt like I showed easier, do NOT run easy_install and it should be fine.