0
点赞
收藏
分享

微信扫一扫

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

caoxingyu 2023-01-27 阅读 148


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 条评论