Linux 64位下一键安装scipy等科学计算环境

Linux 64位下一键安装scipy等科学计算环境

采用scipy.org的各种方法试过了,安装还是失败。找到了一键式安装包Anaconda,基本python要用到的库都齐了,而且还可以选择安装到其他目录下。

Anaconda is an easy-to-install free package manager, environment manager, Pythondistribution, and collection of over 720 open source packages offering free community support.

https://docs.continuum.io/anaconda/index

安装这个自动安装下面的机器学习算法包:

sciki-learn

  • Simple and efficient tools for data mining and data analysis
  • Accessible to everybody, and reusable in various contexts
  • Built on NumPy, SciPy, and matplotlib
  • Open source, commercially usable - BSD license
http://scikit-learn.org/stable/

1 安装 anaconda2

我选择python2.7的Linux安装包,安装的目录是:

/opt/anaconda2

一直使用的是python2.7.x,于是下载下面的包:

$ nohup wget -c http://repo.continuum.io/archive/Anaconda2-4.0.0-Linux-x86_64.sh &
按国内的网速,基本下一夜吧!也可以到我的FTP上下载:

$ wget ftp://pub:public@pepstack.com/bin/Anaconda2-5.2.0-Linux-x86_64.sh

下载后解压安装。不解释。


# bash Anaconda2-4.0.0-Linux-x86_64.sh

安装完毕后执行一下:

# cd /opt/anaconda2/bin
# ./python

输出:

Python 2.7.11 |Anaconda 4.0.0 (64-bit)| (default, Dec  6 2015, 18:08:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import scipy
>>> import numpy
>>> import matplotlib

>>> import sklearn

>>> import mysql.connector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mysql.connector
>>> import theano
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named theano

./pip install --upgrade pip
./pip install theano

2 解决mysql.connector错误的问题

./pip install $pkg 查看哪些包$pkg可用:

https://docs.continuum.io/anaconda/pkg-docs

./pip install mysql-connector-python

失败!

./pip install mysql-python

失败!

于是手工安装:

# cd /opt/anaconda2/pkgs
# wget ftp://pub:public@pepstack.com/tarball/mysql-connector-python-1.2.0.tar.gz
# tar -zxf mysql-connector-python-2.1.1.tar.gz
# cd mysql-connector-python-2.1.1
# ../../bin/python setup.py build
# ../../bin/python setup.py install
# cd /opt/anaconda2/bin
# python -c "import mysql.connector"
成功!

3 安装 python-inotify

# cd /opt/anaconda2/pkgs
# wget ftp://pub:public@pepstack.com/tarball/pathlib-1.0.1.tar.gz
# wget ftp://pub:public@pepstack.com/tarball/JanKanis-python-inotify.tar.gz
(解压略)

# cd /opt/anaconda2/pkgs/pathlib-1.0.1
# ../../bin/python setup.py build
# ../../bin/python setup.py install
# cd /opt/anaconda2/pkgs/JanKanis-python-inotify
# ../../bin/python setup.py build
# ../../bin/python setup.py install
# cd /opt/anaconda2/bin
# python -c "import inotify"
成功!

4 安装 google tensor

https://github.com/tensorflow/tensorflow

TensorFlow is an Open Source Software Library for Machine Intelligence

下载CPU版本:

$ wget https://files.pythonhosted.org/packages/8c/0c/1a55ce5bc234291cac78092436e1daf5688c03221ed76f9b6e828618a9da/tf_nightly-1.10.0.dev20180621-cp27-cp27mu-manylinux1_x86_64.whl

然后安装:

$ sudo /opt/anaconda2/bin/pip install /path/to/tensorflow-0.8.0-cp27-none-linux_x86_64.whl


测试:

$ /opt/anaconda2/bin/python -c "import tensorflow"



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

车斗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值