1

I have a python2.6 installed on Oracle linux. I decided to use a newer python version and installed python 2.7.13.

I have also installed pip to manage packages.

Now if I use pip to install a package it still installs it to the old location: /usr/lib/python2.6/site-packages

Is there a way to force pip to install packages for the newer python 2.7 version?

Lukas Würzburger
  • 6,543
  • 7
  • 41
  • 75
Kev
  • 11
  • 4

3 Answers3

0

Posable Repeat Post

"Use a version of pip installed against the Python instance you want to install new packages to.

In many distributions, there may be separate python2.6-pip and python2.7-pip packages, invoked with binary names such as pip-2.6 and pip-2.7. If pip is not packaged in your distribution for the desired target, you might look for a setuptools or easyinstall package, or use virtualenv (which will always include pip in a generated environment).

pip's website includes installation instructions, if you can't find anything within your distribution." ~Charles Duffy

Taken from How to install a module use pip for specific version of?

Community
  • 1
  • 1
Tyrell
  • 896
  • 7
  • 15
  • 26
0

Did you check Install a Python package into a different directory using pip?.

To install in specified target directory use "pip install --target= "

Community
  • 1
  • 1
user245011
  • 65
  • 1
  • 9
0

Oracle Linux uses the system-installed version of Python for almost all of its command-line utilities, so changing that could irreparably damage your system.

Instead of replacing the default Python install, you should strongly consider using Python 2.7 from Software Collections instead.

Using Software Collections means that the install of Python 2.7 is separated from the system install, so you don't run the risk of damaging your system. You can then make it available to your applications via the scl tool.

Djelibeybi
  • 78
  • 7