我现在在使用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