我已經從Mountain Lion升級到Mavericks,並更新了Macports及其過期的軟件包。我已經安裝了numpy 1.7,但問題是python使用的仍然是numpy 1.6。以下是關於我的系統的一些信息。無法在OS X Mavericks上導入numpy的正確版本
>> python -c 'import numpy; print numpy.__version__'
給出
1.6.2
其示出了有源numpy的版本是1.6.2
>> port installed | grep numpy
給出
py27-numpy @1.7.1_0 (active)
其示出了有源numpy的版本是1.7.1_0
>> port installed | grep python
給出
gnome-doc-utils @0.20.10_0+python27 (active)
gtk-doc @1.18_0+python27 (active)
ipython_select @0.3_1 (active)
opencv @2.4.6.1_2+python27 (active)
py27-ipython @0.13.2_0+notebook+parallel+scientific
py27-ipython @1.1.0_0+scientific
py27-ipython @1.1.0_0+notebook+parallel+scientific (active)
py27-wxpython-3.0 @2.9.5.0_0 (active)
py27-wxpython-devel @2.9.4.0_0
python24 @2.4.6_10 (active)
python27 @2.7.5_0
python27 @2.7.5_1 (active)
python_select @0.3_2
python_select @0.3_3 (active)
swig-python @2.0.9_0
swig-python @2.0.10_0 (active)
xorg-libxcb @1.9.1_0+python27 (active)
xorg-xcb-proto @1.8_0+python27 (active)
其中顯示,活動python版本是python27。
此外,port select python
給
Available versions for python:
none
python24
python25-apple
python26-apple
python27
python27-apple (active)
什麼是'numpy .__ file__'?你可能會選擇一個系統。 '哪個python'告訴你它在'/ opt/local'中? – Evert
在命令行中,運行'which python'或'ls -l $(哪個python)'來檢查鏈接。另外,請輸入'port select python',以查看哪個python端口告訴系統使用。 – askewchan
@void:macports有什麼問題?我正在使用它,因爲它在Ubuntu中被認爲與apt類似。其實,我幾個月前纔開始使用Mac。 – skyuuka