Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为python2.7安装numpy和scipy_Python_Python 2.7_Numpy - Fatal编程技术网

如何为python2.7安装numpy和scipy

如何为python2.7安装numpy和scipy,python,python-2.7,numpy,Python,Python 2.7,Numpy,我使用了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

我使用了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文件


问题和解决方案是什么?

实际上最好使用这是一个管理python包的好工具。 然后您可以键入:

  • pip安装numpy
  • pip安装sicpy

简易方法:

  • 使用pip并在终端上执行以下命令: pip安装numpy pip安装scipy 注意:要安装特定版本,请使用“==”作为后缀

     e.g. `pip install numpy==1.13.3`
    
  • 使用easy_在终端上安装并执行以下命令:

    easy\u install numpy

    轻松安装scipy

  • 笨重的方式(传统版本)

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

    步骤2:在所有包所在的位置提取包 有(通常是prefix/lib/pythonX.Y/site包)。你会 提取后获取文件“setup.py”

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

    是否可以使用
    python-m pip install mypy scipy
    ?请尝试“python setup.py安装”