在Ubuntu 12.04上使用pip在虚拟环境中安装scipy

3
我希望在Ubuntu 12.04的虚拟环境中安装scipy。由于它是在虚拟环境中安装的,所以我必须使用pip,apt-get不起作用。我已经阅读了 Installing SciPy with pip主题,但现在答案不起作用了。如果我运行"pip install svn+http://svn.scipy.org/svn/scipy/trunk/#egg=scipy"或"pip install git+http://github.com/scipy/scipy/", 都会出错。你能否给我一个可行的逐步命令列表,以便在Ubuntu 12.04的虚拟环境中安装scipy(包括任何依赖项,因为我没有安装numpy(我不知道如何安装))?谢谢。
忘记一件事:我在虚拟环境中使用python3。安装的scipy应该可以被导入。
1个回答

4
在仅带有Python 2.7的Ubuntu 12.04服务器上,安装一个不与Python 2冲突的Python3虚拟环境以及可用于Python3的Scipy包,请执行以下命令:
sudo apt-get install python-pip
sudo pip install virtualenv
sudo apt-get install python3
virtualenv -p /usr/bin/python3 py3env
. py3env/bin/activate
sudo apt-get install python3-scipy
sudo apt-get build-dep python3-scipy
pip install numpy
pip install scipy

现在您已经准备好了。最后一个小提示:要找到python3的位置,请键入:whereis python3。
祝你好运!

嘿,你能解释一下为什么在你的过程中会安装全局和虚拟的Scipy吗?这样做有什么好处吗? - HeyWatchThis

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接