Python Can';t在生产服务器上安装SciPy

Python Can';t在生产服务器上安装SciPy,python,python-2.7,numpy,scipy,ubuntu-14.04,Python,Python 2.7,Numpy,Scipy,Ubuntu 14.04,我正试图在云中的Ubuntu机器上安装SciPy。以下是我遵循的步骤: sudopip安装numpy sudo-apt-get-install-gfortran sudo apt get安装libblas dev sudo apt get安装liblapack dev sudo-apt-get-install-g++ sudopip安装scipy 请参考Ubuntu 14.04和Python 2.7.6。我没有安装Python,它已经在机器中了,就像pip和easy_install一样。以下

我正试图在云中的Ubuntu机器上安装SciPy。以下是我遵循的步骤:

  • sudopip安装numpy
  • sudo-apt-get-install-gfortran
  • sudo apt get安装libblas dev
  • sudo apt get安装liblapack dev
  • sudo-apt-get-install-g++
  • sudopip安装scipy
请参考Ubuntu 14.04和Python 2.7.6。我没有安装Python,它已经在机器中了,就像pip和easy_install一样。以下是pip.log:

(.text+0x20): undefined reference to `main'

collect2: error: ld returned 1 exit status

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':

(.text+0x20): undefined reference to `main'

collect2: error: ld returned 1 exit status

error: Command "/usr/bin/gfortran -Wall -g -L/opt/bitnami/common/lib -L/opt/bitnami/common/lib build/temp.linux-x86_64-2.7/numpy/core/blasdot/_dotblas.o -L/usr/lib
-L/opt/bitnami/python/lib -Lbuild/temp.linux-x86_64-2.7 -lopenblas -lpython2.7 -lgfortran -o build/lib.linux-x86_64-2.7/numpy/core/_dotblas.so" failed with exit status 1

----------------------------------------  
Cleaning up...   Removing temporary dir /tmp/pip_build_root... Command /opt/bitnami/python/bin/.python2.7.bin -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Lm8nxq-record/install-record.txt
    --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/numpy Exception information: 

Traceback (most recent call last):
File "/opt/bitnami/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 130, in main
    status = self.run(options, args)   File "/opt/bitnami/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)   File "/opt/bitnami/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)   File "/opt/bitnami/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 706, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)   File "/opt/bitnami/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd)) InstallationError: Command /opt/bitnami/python/bin/.python2.7.bin -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Lm8nxq-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/numpy
pip文件:

#!/opt/bitnami/python/bin/.python2.7.bin
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.5.6','console_scripts','pip'
__requires__ = 'pip==1.5.6' import sys from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
    )
简易安装文件:

#!/usr/bin/env /opt/bitnami/python/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'distribute==0.6.34','console_scripts','easy_install'
__requires__ = 'distribute==0.6.34' import sys from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('distribute==0.6.34', 'console_scripts', 'easy_install')()
    )
请帮忙

这是由gfortran编译器标志引起的吗?只是怀疑而已。

Ubuntu软件包 SciPy手册:

皮普 另一种办法是:

我刚刚在AWS Ubuntu14.04机器上测试了它,经过一个很长的编译过程和大量的警告,一切似乎都正常


我通常建议使用后者,因为它适用于任何virtualenv,而前者在系统范围内安装软件包。

这个问题仍然存在,因此我删除了
/opt/bitnami/python
上的自定义安装,并开始使用系统安装,现在一切正常

我使用安装了scipy和numpy

sudo apt-get install python-numpy python-scipy

通过更改以下环境变量,我可以在bitnami上安装numpy/scipy:

export LDFLAGS="-shared"
然后,安装到scipy的步骤如下:

sudo apt-get update -y
sudo apt-get install python-pip python-dev build-essential
sudo pip install numpy
sudo apt-get install libatlas-base-dev gfortran
sudo pip install scipy

我确实通过apt get安装了它们,但python表现得好像没有安装:没有名为SCIPY的模块。它们可能安装在不同的python解释器上。尝试pip方式,这也将在virtualenv中工作。我如您所述做了,但同样的错误再次显示:(,我不确定,但我认为这与gfortran编译器标志有关
export LDFLAGS="-shared"
sudo apt-get update -y
sudo apt-get install python-pip python-dev build-essential
sudo pip install numpy
sudo apt-get install libatlas-base-dev gfortran
sudo pip install scipy