当前位置:   article > 正文

Linux下安装numpy的一些问题_importerror: error importing numpy: you should not

importerror: error importing numpy: you should not try to import numpy from

在解压numpy安装包后,进入解压包运行python setup.py install命令时出现

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

需要先安装python-dev即:sudo apt-get install python-dev

之后运行python setup.py install命令成功。但运行from numpy import * 出现

ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there. 

这是因为没有退出numpy解压包。退出后运行from numpy import * 成功。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/595789
推荐阅读
相关标签
  

闽ICP备14008679号