早上好,
我已经尝试了一天在运行 Ubuntu 的 VM 上设置和安装 numpy。然而我一直没有成功。Python 2.7 安装正确(为什么它没有附带所有需要的库?)。但是,在尝试构建 numpy 时,出现以下错误;
>>
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
error: build/src.linux-i686-2.7/numpy/distutils/__config__.py: Permission denied
>>
如果我尝试在我的 python 解释器中导入 numpy,我会得到以下信息
>>> numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'numpy' is not defined
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 137, in <module>
import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 4, in <module>
from type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 5, in <module>
import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_AsASCIIString
>>>
我要做的就是将 python 与 numpy 库一起使用。这不应该那么难,不是吗?
干杯。
杰里米