我現在在使用Mountain Lion,並且我已經使用macports安裝了python27和numpy。問題是我不能從python導入numpy。據我所知,Mountain Lion的默認python是python 2.7。使用端口安裝numpy(Python默認版本問題)
我試過「導入numpy」與兩個python(默認 - 2.7.2和端口 - 2.7.3)。 它使用默認的一個,但沒有與Python 2.7.3。
我已經使用「端口選擇」選擇了2.7.3。
這些都是一些端口命令的結果:
$ port installed|grep python
python24 @2.4.6_10 (active)
python27 @2.7.3_0
python27 @2.7.3_1 (active)
python_select @0.3_1 (active)
$ port installed|grep numpy
py24-numpy @1.6.2_0 (active)
py27-numpy @1.6.2_0 (active)
我真的需要與正在使用的MacPorts Python安裝2.7.3使用numpy的。
有人知道嗎?
'import numpy; print numpy .__ file__'是做什麼用的? – User
對我來說,這似乎是兩個python版本,並且都有不同的模塊位置。 – User