python2.7.8环境安装笔记
python2.7.8环境安装笔记
yum -y install zlib zlib-devel openssl-devel gcc python-devel
1.python 2.7.8安装
cd /usr/local/class="lazy" data-src/python && tar xf Python-2.7.8.tgz && cd Python-2.7.8
./configure --prefix=/usr/local/python2.7.8 && make && make install
mv /usr/bin/python /usr/bin/python_old && ln -s /usr/local/python2.7.8/bin/python2.7 /usr/bin/python
2.源码安装setuptools和pip
tar xf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install
tar xf pip-6.1.1.tar.gz
cd pip-6.1.1
python setup.py build
python setup.py install
vim /etc/profile
==========================
#set python_pip environment
export PATH=$PATH:/usr/local/python2.7.8/bin
==========================
(手头上一台CentOS,自带的python2.6,版本较低,所以就自己下了个2.7.9,手动编译安装,然后安装pip,发现报错: No module named 'pip._vendor.requests' 上网查了一圈,最后在stackoverflow找到了答案,发现是因为在编译时没有找到ssl相关的模块导致。 执行yum install openssl-devel,然后重新编译python2.7.9,问题解决。...)
whereis pip 检查pip是否安装上
3.源码安装MySQLdb库(参考:http://www.jb51.net/article/60631.htm)
unzip MySQLdb1-master.zip
cd MySQLdb1-master
#vi site.cfg
================================
threadsafe = False
mysql_config = /usr/bin/mysql_config
================================
yum -y install mysql mysql-devel mysql-connector-odbc (mysql_config在mysql包(这个就是mysql-client))
python setup.py build
python setup.py install
#验证是否安装成功:import MySQLdb
(build时报错:error: command 'gcc' failed with exit status 1 解决:yum install gcc python-devel)
4.安装simplejson
pip install simplejson
5.node环境部署
wget http://nodejs.org/dist/v0.12.2/node-v0.12.2.tar.gz
tar xf node-v0.12.2.tar.gz && cd node-v0.12.2
./configure --prefix=/usr/local/nodejs && make && make install
(报错:确实bz2 解决:http://blog.csdn.net/liubo2012/article/details/8367603)
yum -y install bzip2*
cd Python-2.7.8/Modules/zlib
./configure && make && make install
cd Python-2.7.8 && python setup.py install
重新进入node-v0.12.2 make && make install
配置环境:
vim /etc/profile
#set nodejs environment
export PATH=$PATH:/usr/local/nodejs/bin
source /etc/profile
6.数据库安装(参考rpm安装mysql5.6)
vim /etc/my.cnf
[client]
socket = /home/mysql/data/mysql.sock
[mysqld]
basedir = /usr/ #这里是mysql的命令路径系统默认进入./bin/寻找相应的命令
datadir = /home/mysql/data
socket = /home/mysql/data/mysql.sock
character-set-server=utf8
max_connect_errors = 500
max_connections = 8000
max_allowed_packet = 500M
thread_cache_size = 64
wait_timeout = 180
default-storage-engine = MYISAM
socket = /home/mysql/data/mysql.sock
slow_query_log = ON
slow_query_log_file = /home/mysql/data/analysis1-slow.log
long_query_time = 2
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341