一些Centos Python 生產(chǎn)環(huán)境的部署命令(推薦)
Just notes
拿到一臺(tái)干凈的centos之后, 初始化Python環(huán)境, 一些命令和問題記錄而已
可以搞成腳本自動(dòng)初始化, 當(dāng)然, 用docker更好
基礎(chǔ)環(huán)境
1. 創(chuàng)建用戶
sudo adduser newuser sudo passwd newuser # 設(shè)置授權(quán)不需要輸入密碼 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
一些服務(wù)
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
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
總結(jié)
以上所述是小編給大家介紹的一些Centos Python 生產(chǎn)環(huán)境的部署命令,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Python+Pika+RabbitMQ環(huán)境部署及實(shí)現(xiàn)工作隊(duì)列的實(shí)例教程
- Python自動(dòng)化部署工具Fabric的簡(jiǎn)單上手指南
- Python Web框架Tornado運(yùn)行和部署
- Windows下Python的Django框架環(huán)境部署及應(yīng)用編寫入門
- Python的自動(dòng)化部署模塊Fabric的安裝及使用指南
- 在Linux系統(tǒng)上部署Apache+Python+Django+MySQL環(huán)境
- 使用PyCharm配合部署Python的Django框架的配置紀(jì)實(shí)
- Python下Fabric的簡(jiǎn)單部署方法
相關(guān)文章
Python通過正則庫(kù)爬取淘寶商品信息代碼實(shí)例
這篇文章主要介紹了Python通過正則庫(kù)爬取淘寶商品信息代碼實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-03-03Appium+python+unittest搭建UI自動(dòng)化框架的實(shí)現(xiàn)
本文主要介紹了Appium+python+unittest搭建UI自動(dòng)化框架的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2024-03-03淺談python 線程池threadpool之實(shí)現(xiàn)
這篇文章主要介紹了淺談python 線程池threadpool之實(shí)現(xiàn),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-11-11Python模塊對(duì)Redis數(shù)據(jù)庫(kù)的連接與使用講解
這篇文章主要介紹了Python模塊對(duì)Redis數(shù)據(jù)庫(kù)的連接與使用,通過實(shí)例代碼給大家介紹了Python連接Redis數(shù)據(jù)庫(kù)方法,Python使用連接池連接Redis數(shù)據(jù)庫(kù)方法,感興趣的朋友跟隨小編一起看看吧2021-07-07Python OpenCV中的resize()函數(shù)的使用
這篇文章主要介紹了Python OpenCV中的resize()函數(shù)的使用,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-06-06Python使用functools實(shí)現(xiàn)注解同步方法
這篇文章主要介紹了Python使用functools實(shí)現(xiàn)注解同步方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2018-02-02