Centos6.5+Python2.7 +ffmpeg+opencv2自动安装脚本

来源:互联网 发布:批量裁剪图片软件 编辑:程序博客网 时间:2024/06/07 03:24

今天安装opencv折腾了多个小时,为以后安装少走弯路,脚本安装

完整 脚本如下:

#! /bin/bashsudo yum install -y gcc g++ gtk+-devel libjpeg-devel libtiff-devel jasper-devel libpng-devel zlib-devel cmake unzip sqlite-devel readline-devel bzip2-devel openssl-devel ncurses-develsudo yum install -y yum-prioritiessudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmsudo yum install -y eigen3-devel --enablerepo=epelsu -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm'sudo yum install -y ffmpeg-develexport PYTHON_PREFIX=/usr/local/python-2.7.10wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgztar -zxvf Python-2.7.10.tgzcd Python-2.7.10./configure --enable-shared --prefix=$PYTHON_PREFIX CFLAGS="-O3 -fPIC"makesudo make installcd ..sudo cp $PYTHON_PREFIX/lib/libpython2.7.so.1.0 /usr/local/libsudo ln -s /usr/local/lib/libpython2.7.so.1.0 /usr/local/lib/libpython2.7.sosudo echo '/usr/local/lib' > /etc/ld.so.confsudo /sbin/ldconfigsudo /sbin/ldconfig -vwget https://raw.github.com/pypa/pip/master/contrib/get-pip.py$PYTHON_PREFIX/bin/python get-pip.py$PYTHON_PREFIX/bin/pip install -r ./requirements.txtwget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.9/opencv-2.4.9.zipunzip opencv-2.4.9cd opencv-2.4.9mkdir buildcd buildcmake ../ -DCMAKE_BUILD_TYPE=RELEASE \-DCMAKE_INSTALL_PREFIX=/usr/local \-DBUILD_EXAMPLES=ON \-DWITH_EIGEN=ON \-DBUILD_NEW_PYTHON_SUPPORT=ON \-DINSTALL_PYTHON_EXAMPLES=ON \-DPYTHON_EXECUTABLE=$PYTHON_PREFIX/bin/python2.7 \-DPYTHON_INCLUDE_DIR=$PYTHON_PREFIX/include/python2.7/ \-DPYTHON_LIBRARY=$PYTHON_PREFIX/lib/libpython2.7.so.1.0 \-DPYTHON_NUMPY_INCLUDE_DIR=$PYTHON_PREFIX/lib/python2.7/site-packages/numpy/core/include/ \-DPYTHON_PACKAGES_PATH=$PYTHON_PREFIX/lib/python2.7/site-packages/ \-DBUILD_PYTHON_SUPPORT=ONmakesudo make install


requirements.txt

backports-abc==0.4backports.shutil-get-terminal-size==1.0.0backports.ssl-match-hostname==3.5.0.1certifi==2016.2.28configparser==3.5.0coverage==4.1cycler==0.10.0Cython==0.24decorator==4.0.10entrypoints==0.2.2functools32==3.2.3.post2ipykernel==4.3.1ipython==4.2.0ipython-genutils==0.1.0ipywidgets==5.1.5Jinja2==2.8jsonschema==2.5.1jupyter==1.0.0jupyter-client==4.3.0jupyter-console==4.1.1jupyter-core==4.1.0Keras==1.0.5MarkupSafe==0.23matplotlib==1.5.1mistune==0.7.3nbconvert==4.2.0nbformat==4.0.1notebook==4.2.1numpy==1.10.3pandas==0.18.1pathlib2==2.1.0pickleshare==0.7.2Pillow==3.3.0Pygments==2.1.3pyparsing==2.1.5pyreadline==2.1python-dateutil==2.5.3pytz==2016.4PyYAML==3.11pyzmq==15.2.0qtconsole==4.2.1scikit-learn==0.17.1scipy==0.17.1seaborn==0.7.1simplegeneric==0.8.1singledispatch==3.4.0.3six==1.10.0Theano==0.8.2tornado==4.3traitlets==4.2.1virtualenv==15.0.2widgetsnbextension==1.2.3


1 0
原创粉丝点击