1

I have a remote machine with python 2.6 as the default package on the machine. I installed numpy using yum install numpy.

I then installed python 2.7 using the instructions available python 2.7 install link in the directory /usr/src/. I then put this alias

alias python=/usr/src/Python-2.7.8/python 

in ~/.bashrc.

So numpy is already installed on the machine but python 2.7 can't pick it up? Should I uninstall it? How do I install it for version 2.7.

The commands would be vary helpful.

Could I pip install to a specific version? I tried this command but it is incorrect.

pip-2.7 install numpy

Thanks

scalauser
  • 449
  • 1
  • 12
  • 23
  • instead of chasing version and installations I would suggest you to use virtual environments. Refer here https://virtualenv.pypa.io/en/latest/index.html – aberna Jan 21 '15 at 09:16
  • 1
    possible duplicate of [pip: dealing with multiple Python versions?](http://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions) – NDevox Jan 21 '15 at 09:40
  • Also `python -m pip install numpy` is a neat trick if you want to use the right pip version for your `python` interpreter – cel Jan 21 '15 at 15:05
  • *"I tried this command but it is incorrect"* - did you get an error message? On my Ubuntu machine the command would be `pip2.7` (without the hypen). – ali_m Jan 24 '15 at 18:14

1 Answers1

1

you can do

pythonx.y -m pip install numpy

to install numpy on python version x.y