无法导入numpy anaconda

时间:2016-04-13 06:41:21

标签: python numpy

当我尝试在python中运行:import numpy as np时,我得到:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kevin/anaconda2/lib/python2.7/site-packages/numpy/__init__.py", line 201, in <module>
    from . import random
  File "/home/kevin/anaconda2/lib/python2.7/site-packages/numpy/random/__init__.py", line 99, in <module>
    from .mtrand import *
ImportError: /home/kevin/anaconda2/lib/python2.7/site-packages/numpy/random/mtrand.so: undefined symbol: PyFPE_jbuf

我正在运行ubuntu 16.04并安装了2个python。我还安装了anaconda:

kevin@phantom:~$ which python
/home/kevin/anaconda2/bin/python

我做了conda update --all我现在有了:

kevin@phantom:~$ python --version
Python 2.7.11 :: Anaconda custom (64-bit)

我做错了什么?我该怎么做才能解决这个问题?

2 个答案:

答案 0 :(得分:1)

我重新安装了anaconda,它出于某种原因......

答案 1 :(得分:0)

我在anaconda中创建了一个新环境,并在新环境中安装了numpy。奏效了。