這篇文章主要介紹了一些Centos Python 生產環境的部署命令,非常不錯,具有參考借鑒價值,需要的朋友參考下吧
Just notes
拿到一台乾淨的centos之後, 初始化Python環境, 一些指令和問題記錄而已
可以搞成腳本自動初始化, 當然, 用docker更好
sudo adduser newuser sudo passwd newuser # 设置授权不需要输入密码 sudo /usr/sbin/visudo newuser ALL=NOPASSWD: ALL
參考文件
#wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm sudo rpm -Uvh epel-release-6*.rpm
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
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
ssh-keygen -t rsa add ~/.ssh/id_rsa.pub to git or github
sudo yum install mysql sudo yum install mysql-devel* -y sudo yum install mysql-server sudo /sbin/service mysqld start
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: not constant
_mysql.c: In function '_mysql_ConnectionObject_getattr':
_mysql.c:2666: error:
--------------------------------- -------
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
相關推薦:
python3 requests中使用ip代理池隨機產生ip的實例
######################以上是一些Centos Python 生產環境的部署指令的詳細內容。更多資訊請關注PHP中文網其他相關文章!