教程:https://blog.csdn.net/mx472756841/article/details/50739599
https://www.jianshu.com/p/6425d18d3e47
首先下载安装包:wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
解压:tar xf Python-2.7.6.tar.xz
非root权限下,下载你需要的python,解压之后。所有的路径都是你自己的路径和适合你的包版本
- cd /storage/st20/python-2.7.14 (你解压之后的Python包的位置)
- ./configure --prefix=/storage/st20/python-2.7.14 --enable-optimizations --enable-shared CFLAGS=-fPIC (先安装Python,设置环境,安装pip ,后安装caffe)
- make -j10
- make install -j10(安装快点~)
- 修改环境变量:vi ~/.bash_profile
-
PATH=/storage/st20/python-2.7.6/bin:$PATH
LD_LIBRARY_PATH=/storage/st20/python-2.7.6/lib:$LD_LIBRARY_PATH
export PATH
export LD_LIBRARY_PATH
- 生效:source ~/.bash_profile
-
Python2.7.6安装pip
首先:安装setuptools
- wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.3.tar.gz#md5=f07e4b0f4c1c9368fcd980d888b29a65
- tar -zxvf setuptools-12.0.3.tar.gz
- cd setuptools-12.0.3
- python setup.py install --prefix=/storage/st20/python-2.7.14
- 安装pip: wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
- tar zvxf 1.5.5.tar.gz
- cd pip-1.5.5
- python setup.py install --prefix=/storage/st4/python-2.7.14
- 查看安装 pip list
- 升级pip : pip install --upgrade setuptools pip
- pip install nltk