如何为 python2.7 安装 numpy 和 scipy



我使用了redhat Linux。我想为 python2.7 安装 numpy 和 scipy。我尝试安装并执行以下活动:

1. download the numpy and scipy using wget command
2. extract the tar file using the tar command 
3. when I build using the python setup.py build and when I try the python setup.py commands the error happen as "This is the wrong setup.py file to run"    The setup.py file is found inside the folder.

例如:

/home/desktop/kk/python setup.py build

KK内部有 setup.py 文件。

问题和解决方案是什么?

简单的方法:

  1. 使用 pip 并在终端上执行以下命令:点子安装数字点安装西比注意:要安装特定版本,请使用"=="作为后缀

     e.g. `pip install numpy==1.13.3`
    
  2. 使用easy_install并在终端上执行以下命令:

    easy_install numpy

    easy_install scipy

笨重的方式(旧版(

步骤1:从pypi(最好(或任何其他来源下载软件包。

步骤 2:在所有包所在的位置提取包 那里(通常是前缀/lib/pythonX.Y/site-packages(。你会 提取后获取文件"setup.py"。

第 3 步:打开终端并导航到"setup.py"的位置 文件并执行python setup.py命令。

实际上

最好使用pip,这是一个管理python包的好工具。这是安装指南然后,您可以键入:

  • 点子安装数字
  • 点安装西皮

最新更新