代码之家  ›  专栏  ›  技术社区  ›  batuman

已安装numpy,但无法导入多数组

  •  0
  • batuman  · 技术社区  · 6 年前

    我正在努力 openface 工作。

    这是安装说明。

    >conda config --add channels conda-forge
    >conda install opencv numpy pandas scipy scikit-learn scikit-image dlib txaio twisted autobahn OpenSSL pyopenssl imagehash service_identity
    

    我移除了numpy并重新安装以确保安装了numpy。

    Downloading and Extracting Packages
    openblas-0.3.3       | 13.7 MB   | ##################################### | 100% 
    numpy-1.15.4         | 8.9 MB    | ##################################### | 100% 
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    

    所以安装了numpy。 但我尝试导入numpy,并将错误设置为

    (openface) nyan@nyan-Inspiron-7537:~$ python
    Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 17:05:42) 
    [GCC 7.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 180, in <module>
        from . import add_newdocs
      File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
        from numpy.lib import add_newdoc
      File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
        from .type_check import *
      File "/usr/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
        import numpy.core.numeric as _nx
      File "/usr/lib/python2.7/dist-packages/numpy/core/__init__.py", line 14, in <module>
        from . import multiarray
    ImportError: cannot import name multiarray
    >>> 
    

    可能有什么问题?

    1 回复  |  直到 6 年前
        1
  •  0
  •   w-m    6 年前

    似乎是对的 python 可执行文件,因为它在版本字符串中打印水蟒。但错误消息中的numpy路径是“/usr/lib/…”,这可能不是您的蟒蛇路径。

    如果可能,您应该删除损坏的系统编号,并确保正确使用Conda环境,请参见 Managing environments .