1

I am having problems installing scipy on a linux system. This question has been asked before, but I couldn't exactly figure out the solution, especially what is the latest solution because it seems that lot of these repositories get updated constantly, probably so are the solutions. I thought of posting this in the previous post with this issue, but noted that I should only provide an answer to teh issue, not post my problem there! So here I am creating a new post. I know this post will be voted down, blocked, chided.... but please be kind in also pointing to what exactly could be the issue I have. I have scoured through the web, particularly stackoverflow for ways to install scipy in the linux system I am using, and to the best of my knowledge and abilities (limited, I am not a software pro) have used various suggestions posted here. So here is what I have: 1) I am on linux system:

Linux compute-0-25.local 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

2) Installed virtualenv, created and activated a virtual environment:

curl -O -k https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz
tar xvfz virtualenv-1.9.1.tar.gz
cd virtualenv-1.9.1
/usr/local/python/2.6.5/bin/python virtualenv.py myVE
. virtualenv-1.9.1/myVE/bin/activate

3) Installed numpy:

pip install numpy

4) Tried installing scipy:

pip install scipy

Got the following error in the pip.log file: https://gist.github.com/hariiyer16/5910959

Also tried (based on a previous post here):

pip install git+http://github.com/scipy/scipy/

This did not work however. Also tried easy_install which did not work. Will post these errors too if it helps.

From going through some of the previous posts, I might have to get the scipy dependencies (libamd2.2.0 libblas3gf libc6 libgcc1 libgfortran3 liblapack3gf libumfpack5.4.0 libstdc++6 build-essential gfortran libatlas-sse2-dev python-all-dev). Can someone tell me if that's the case? In that case, I have to check with our admin since I do not have superuser privileges (can only install stuff in my directory). But before asking teh admin, I want to be sure of what dependencies needs to be installed. It would be great to get some pointers along with some vote-downs. Would really appreciate that. Previously, I was able to install numpy, scipy etc on my Mac (snow leopard) with help from folks here, and grateful for that. But this one has been pretty daunting and have spent far too much time on it.

Thanks.

4

1 回答 1

5

经过大量尝试,我在新的虚拟环境中进行了 Python 的全新安装。由于我进行了全新安装,因此我使用了 Python 2.7.5。然后启动虚拟环境。然后用来pip install安装numpyand scipy,还是不行!(不知道为什么。很高兴知道有人有线索)。但是,尝试过easy_install并且 numpy 和 scipy 都有效。很高兴它起作用了,但我不会安然入睡,因为不知道真正的问题是什么。以下是完整的代码:

1)安装python

wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar -zxvf Python-2.7.5.tgz
mkdir ~/Python-2.7
cd Python-2.7.5
make clean
./configure --help #get to know the options in configure
./configure --help | grep -i ucs $get to know the UCS options
./configure --prefix=/home/org/username/Python-2.7 #install Python in the Python-2.7 directory
make
make install

2)在新的Python-2.7.5安装中安装virtualenv(virtualenv-1.9.1.tar.gz被解压在一个名为virtualenv-1.9.1的文件夹中)

cd virtualenv-1.9.1/
~/Python-2.7/bin/python setup.py install #this installs virtualenv in the new Python directory
cd ..

3) 使用本地 python 创建一个 virtualenv

mkdir ~/virtualenv-1.9.1/myVE_Python2.7
cd ~/virtualenv-1.9.1/myVE_Python2.7
~/Python-2.7/bin/virtualenv py2.7 --python=/home/org/username/Python-2.7/bin/python2.7

4)激活环境

ls -l virtualenv-1.9.1/myVE_Python2.7/py2.7/bin/
. virtualenv-1.9.1/myVE_Python2.7/py2.7/bin/activate

5) 使用 easy_install 安装 numpy 和 scipy

ls -l virtualenv-1.9.1/myVE_Python2.7/py2.7/bin/
easy_install -U setuptools

出于某种原因, pip install 安装了与 UCS2 版本的 Python 版本不兼容的 UCS4 版本的 numpy。所以不得不对 numpy 和 scipy 使用 easy_install (嗯,这是我最好的猜测)。

easy_install numpy
easy_install scipy
ls -l /home/org/username/virtualenv-1.9.1/myVE_Python2.7/py2.7/lib/python2.7/site-packages

发现以下帖子很有用: Is it possible to install another version of Python to Virtualenv?

使用 pip 安装 SciPy

如何确定 Python 是使用 UCS-2 还是 UCS-4 编译的?

http://www.cyberciti.biz/faq/debian-ubuntu-centos-rhel-linux-install-pipclient/

使用不同的 Python 版本和 virtualenv

谢谢。

于 2013-07-03T03:27:59.383 回答