在ubuntu上安装机器学习模块

里面包含了所有需要的包:

#define 这里只是定义了按回车,然后执行下一步的方法
get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2>/dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}

echo "[$(date)] - install start,Press any key to continue!"
char=`get_char`

#init
sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
sudo cp sources.list /etc/apt/sources.list
sudo apt-get update &&sudo apt-get dist-upgrade
sudo apt-get install language-pack-zh-hans
sudo apt-get install openssh-server
sudo apt-get install build-essential
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install libsdl-dev
sudo apt-get install zip
sudo apt-get install zlib1g-dev
sudo apt-get install ethtool
sudo apt-get install libglib2.0-dev
sudo apt-get install mkisofs
sudo apt-get install git
sudo apt-get install dos2unix
sudo apt-get install netpbm
sudo apt-get install libarchive-zip-perl
sudo apt-get install libxml-libxml-perl
sudo apt-get install chkconfig python-dev
sudo apt-get install libpixman-1-dev
sudo apt-get install tshark
sudo mv /etc/apt/sources.list.old  /etc/apt/sources.list
echo "[$(date)] - init Setup Finished,Press any key to continue!"
char=`get_char`

#install python
tar -zxvf Python-3.6.4.tgz
cd Python-3.6.4
./configure
make
make install
cd ..
echo "[$(date)] - Python Setup Finished,Press any key to continue!"
char=`get_char`

#install numpy
cd numpy
unzip numpy-1.14.0.zip
cd numpy-1.14.0
python3 setup.py install
cd ..
cd ..
echo "[$(date)] - numpy Setup Finished,Press any key to continue!"
char=`get_char`

#install jieba
cd jieba
unzip jieba-0.39.zip
cd jieba-0.39
python3 setup.py install
cd ..
cd ..
echo "[$(date)] - jieba Setup Finished,Press any key to continue!"
char=`get_char`

#install pandas
cd pandas
pip3 install pytz-2017.2-py2.py3-none-any.whl
pip3 install six-1.11.0-py2.py3-none-any.whl
pip3 install python_dateutil-2.6.1-py2.py3-none-any.whl
tar -zxvf pandas-0.22.0.tar.gz
cd pandas-0.22.0
python3 setup.py install
cd ..
cd ..
echo "[$(date)] - pandas Setup Finished,Press any key to continue!"
char=`get_char`

#install scipy
cd scipy
pip3 install scipy-1.0.0-cp36-cp36m-manylinux1_x86_64.whl
cd ..
echo "[$(date)] - scipy Setup Finished,Press any key to continue!"
char=`get_char`

#install sklearn
cd sklearn
pip3 install scikit_learn-0.19.0-cp36-cp36m-manylinux1_x86_64.whl
echo "[$(date)] - sklearn Setup Finished,Press any key to continue!"
char=`get_char`

#install gensim
cd gensim
dpkg -i libbz2-dev_1.0.6-1_amd64.deb
cd ..
cd Python-3.6.4
make
make install
cd ..
cd gensim
pip3 install requests-2.10.0-py2.py3-none-any.whl
tar -zxvf bz2file-0.98.tar.gz
cd bz2file-0.98
python3 setup.py install
cd ..
pip3 install boto-2.48.0-py2.py3-none-any.whl
tar -zxvf smart_open-1.3.5.tar.gz
cd smart_open-1.3.5
cd ..
cd ..
echo "[$(date)] - gensim Setup Finished,Press any key to continue!"
char=`get_char`

#install tensorflow
cd tensorflow
pip3 install protobuf-3.4.0-cp36-cp36m-manylinux1_x86_64.whl
pip3 install wheel-0.30.0-py2.py3-none-any.whl
tar -zxvf html5lib-0.9999999.tar.gz
cd html5lib-0.9999999
python3 setup.py install
cd ..
pip3 install bleach-1.5.0-py2.py3-none-any.whl
tar -zxvf Markdown-2.6.8.tar.gz
cd Markdown-2.6.8
python3 setup.py install
cd ..
tar -zxvf absl-py-0.1.9.tar.gz
cd absl-py-0.1.9
python3 setup.py install
cd ..
pip3 install Werkzeug-0.12.2-py2.py3-none-any.whl
#pip3 install tensorflow_tensorboard-1.5.1-py3-none-any.whl
pip3 install backports.weakref-1.0rc1-py3-none-any.whl
pip3 install tensorflow-1.2.1-cp36-cp36m-manylinux1_x86_64.whl
cd ..
echo "[$(date)] - tensorflow Setup Finished,Press any key to continue!"
char=`get_char`

#install glibc17
cd glibc17
dpkg -i libc6_2.17-0ubuntu5_amd64.deb
dpkg -i libc6-dev_2.17-0ubuntu5_amd64.deb
dpkg -i libc-dev-bin_2.17-0ubuntu5_amd64.deb
dpkg -i libnih1_1.0.3-4ubuntu16_amd64.deb
dpkg -i libnih-dbus1_1.0.3-4ubuntu16_amd64.deb
cd ..
echo "[$(date)] - glibc17 Setup Finished,Press any key to continue!"
char=`get_char`

#replace libstdc
cp libstdc++.so.6.0.20 /usr/lib/x86_64-linux-gnu/
rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 /usr/lib/x86_64-linux-gnu/libstdc++.so.6
echo "[$(date)] - libstdc Setup Finished,Press any key to continue!"
char=`get_char`

#install tflearn
cd tflearn
tar -zxvf olefile-0.43.tar.gz
cd olefile-0.43
python3 setup.py install
cd ..
pip3 install Pillow-4.2.1-cp36-cp36m-manylinux1_x86_64.whl
tar -zxvf tflearn-0.3.2.tar.gz
cd tflearn-0.3.2
python3 setup.py install
cd ..
cd ..
echo "[$(date)] - tflearn Setup Finished,Press any key to continue!"
char=`get_char`

#install keras
cd keras
tar -zxvf PyYAML-3.12.tar.gz
cd PyYAML-3.12
python3 setup.py install
cd ..
pip3 install Keras-2.1.3-py2.py3-none-any.whl
pip3 install h5py-2.7.0-cp36-cp36m-manylinux1_x86_64.whl
cd ..
echo "[$(date)] - keras Setup Finished,Press any key to continue!"
char=`get_char`
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值