I installed additional python 2.7
on my mac and numpy-1.6.2
for python 2.7
, however whenever I want to import numpy
, it will import the numpy
from the preinstalled python
version on my Mac, the version is 1.6.1
, can anybody tell me how can I change the import direction to numpy-1.6.2
??
Asked
Active
Viewed 266 times
1

Jean-Philippe Bond
- 10,089
- 3
- 34
- 60

user2037692
- 11
- 1
2 Answers
2
You must ensure that the library you've just installed and you're trying to import is in your PYTHONPATH
. Also, doing things like that are not most optimal - consider using virtualenv and installing your libraries on per project basis to avoid issues like that and getting a lot more flexibility in managing them.

SpankMe
- 836
- 1
- 8
- 23
0
Check the path of your numpy package:
import numpy
print numpy.__path__
and then replace the entire contents with the downloaded numpy version 1.6.2, if the stuff in the resulting path looks similar to the numpy 1.6.2 download.
Otherwise just delete that stuff (that's in the path) or uninstall it and remove it through some other way and then use:
pip install numpy