linux 下安装python2.7.13
2024-09-01 17:11:01
1.下载所必要的依赖包
yum -y install python-devel openssl openssl-devel gcc sqlite sqlite-devel mysql-devel libxml2-devel libxslt-devel [root@cdh1 20191018]# ll *gz
-rwxrwxrwx 1 root root 389668 Oct 18 14:55 distribute-0.6.10.tar.gz
-rwxrwxrwx 1 root root 1246072 Apr 20 2018 pip-10.0.1.tar.gz
-rwxrwxrwx 1 root root 17076672 Dec 18 2016 Python-2.7.13.tgz
-rwxrwxrwx 1 root root 796957 Apr 24 2016 setuptools-1.4.2.tar.gz
--gz包请自动解压
2.安装python2.7.13
cd /BIG_DATA/EDW/ZYXF_EDW/PYTHON_APP/EDW_ONLINE/20191018/Python-2.7.13
./configure --prefix=/usr/local/python2.7 --with-threads --enable-shared make && make altinstall mv /usr/bin/easy_install /usr/bin/easy_install2.6
mv /usr/bin/python /usr/bin/python2.6 ln -s /usr/local/python2.7/lib/libpython2.7.so /usr/lib
ln -s /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/lib
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python
ln -s /usr/local/python2.7/lib/libpython2.7.so /usr/lib64
ln -s /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/lib64
验证:
[root@cdh4 Python-2.7.13]# python
Python 2.7.13 (default, Oct 28 2019, 16:35:02)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
3.安装安装setuptools
cd /BIG_DATA/EDW/ZYXF_EDW/PYTHON_APP/EDW_ONLINE/20191018/setuptools-1.4.2
python setup.py build
python setup.py install
4.安装安装pip
cd /BIG_DATA/EDW/ZYXF_EDW/PYTHON_APP/EDW_ONLINE/20191018/pip-10.0.1
python setup.py build
python setup.py install ln -s /usr/local/python2.7/bin/pip /usr/bin/pip
测试:
pip install Pillow
5.修改YUM
vim /usr/bin/yum
#!/usr/bin/python2.6
验证:
[root@cdh1 20191018]# yum
Loaded plugins: fastestmirror, security
You need to give some command
Usage: yum [options] COMMAND List of Commands: check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
groupinfo Display details about a package group
groupinstall Install the packages in a group on your system
grouplist List available package groups
groupremove Remove the packages in a group from your system
help Display a helpful usage message
完成!!!
最新文章
- 【接上一篇】winform中dataGridView高度和宽度自适应填充完数据的高度和宽度,即dataGridView根据数据自适应大小
- JVM内存模型与性能调优
- Support for multiple result sets
- 豆制品厂开车超市送货智能手持PDA POS打票机-手持票据打印机
- 把表里的数据转换为insert 语句
- 很好用的mybatis分页解决方案
- PHP之mysql笔记
- css案例学习之盒子模型
- [SignalR]配置路由
- python cookbook学习1
- Arduino上传数据至贝壳物联并与FPGA进行交互
- C#wxpay和alipay
- Hyperledger Fabric Endorsement policies——背书策略
- mvc 过滤器篇
- ELK(ElasticSearch+Logstash+ Kibana)搭建实时日志分析平台
- IIS发布错误及解决
- 探索guava(一)——前置条件Preconditions类
- PHP Mysql-连接
- 本地CS的导出xls代码段
- 查看局域网其它电脑的计算机名和IP
热门文章
- Salesforce LWC学习(九) Quick Action in LWC
- [C++]数据结构:线性表之顺序表
- error_reporting函数引起的error_log配置失效的问题
- SpringBoot: 11.异常处理方式1(自定义异常页面)(转)
- 使用 bash 脚本把 AWS EC2 数据备份到 S3
- 【极简版】OpenGL 超级宝典(第五版)环境配置 VS2010
- (长期更新)【机器学习实践】Pycharm编辑器的使用注意事项
- winform 更新文件上传(一)
- tensorflow搭建神经网络
- HTML的列表表格表单知识点