Just notes
拿到一台干净的centos之后, 初始化Python环境, 一些命令和问题记录而已
可以搞成脚本自动初始化, 当然, 用docker更好
基础环境
1. 创建用户
sudo adduser newuser sudo passwd newuser # 设置授权不需要输入密码 sudo /usr/sbin/visudo newuser ALL=NOPASSWD: ALL
2. EPEL(Fedora Extra Packages for Enterprise Linux repository )
参考文档
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm sudo rpm -Uvh epel-release-6*.rpm
3. 加ius源
包地址
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm sudo rpm -Uvh ius-release-1.0-13.ius.centos6.noarch.rpm
4. 安装python2.7 / python3 / pip
sudo yum install python27 sudo yum install python27-devel then curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo /usr/bin/python2.7 - # pip curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | sudo /usr/bin/python2.7 - extra: install python3 sudo yum install python34u python34u-devel
5. virtualenv
sudo pip install virtualenv
6. gen ssh key
ssh-keygen -t rsa add ~/.ssh/id_rsa.pub to git or github
一些服务
1. install git
sudo yum install git
2. mysql
sudo yum install mysql sudo yum install mysql-devel* -y sudo yum install mysql-server sudo /sbin/service mysqld start
3. redis
sudo yum install redis
4. rabbitmq
sudo yum install rabbitmq-server
问题
[Errno 14] Peer cert cannot be verified or peer cert invalid
add "sslverify=false" in /etc/yum.conf
pip error: ImportError: cannot import name HTTPSHandler
yum install openssl openssl-devel -y
see in sof
MySQL-python
_mysql.c:2642: error: initializer element is not constant
_mysql.c:2642: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset')
_mysql.c: In function ‘_mysql_ConnectionObject_getattr':
_mysql.c:2666: error: ‘_mysql_ConnectionObject' has no member named ‘open'
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/data/home/alarm/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-HgXAQT/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-kx2cSu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-HgXAQT/MySQL-python
处理: yum install mysql-devel
总结
以上所述是小编给大家介绍的一些Centos Python 生产环境的部署命令,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 【雨果唱片】中国管弦乐《鹿回头》WAV
- APM亚流新世代《一起冒险》[FLAC/分轨][106.77MB]
- 崔健《飞狗》律冻文化[WAV+CUE][1.1G]
- 罗志祥《舞状元 (Explicit)》[320K/MP3][66.77MB]
- 尤雅.1997-幽雅精粹2CD【南方】【WAV+CUE】
- 张惠妹.2007-STAR(引进版)【EMI百代】【WAV+CUE】
- 群星.2008-LOVE情歌集VOL.8【正东】【WAV+CUE】
- 罗志祥《舞状元 (Explicit)》[FLAC/分轨][360.76MB]
- Tank《我不伟大,至少我能改变我。》[320K/MP3][160.41MB]
- Tank《我不伟大,至少我能改变我。》[FLAC/分轨][236.89MB]
- CD圣经推荐-夏韶声《谙2》SACD-ISO
- 钟镇涛-《百分百钟镇涛》首批限量版SACD-ISO
- 群星《继续微笑致敬许冠杰》[低速原抓WAV+CUE]
- 潘秀琼.2003-国语难忘金曲珍藏集【皇星全音】【WAV+CUE】
- 林东松.1997-2039玫瑰事件【宝丽金】【WAV+CUE】