凌的博客

您现在的位置是: 首页 > 学无止境 > python > 

python

centos 安装python 3.7.3

2020-04-30 python 1026
'''
https://www.python.org/downloads/release/python-373/

wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar -xvzf Python-3.7.3.tgz
cd Python-3.7.3/
./configure --prefix=/usr/python
make & make install
ln -s /usr/python/bin/python3 /usr/bin/py

如果遇到 setuptools 安装失败的问题
yum install libffi-devel -y
重新编译python
make install

py -m pip install mysql-connector

py -m pip install requests

'''

重新挂载
cd home

mkdir -p www
ln -s /home/www /www
# crontab

/sbin/service crond start
/sbin/service crond stop
/sbin/service crond restart
/sbin/service crond reload

*/20 * * * *

echo "\n40 13 * * * py /www/wwwroot/test.py" >> /etc/crontab

#vi /etc/crontab
#开机启动 定时任务
#编辑定时任务命令必须指定用户 否则不会生效

systemctl enable crond.service

chmod -x /www/wwwroot/test.py
echo "57 13 * * * root /usr/python/bin/python3 /www/wwwroot/test.py" >> /etc/crontab
/bin/systemctl reload crond.service

/bin/systemctl restart crond.service
/bin/systemctl reload crond.service
/bin/systemctl restart crond.service


echo "104.168.171.188 test.vo5.com" >> /etc/hosts

/usr/python/bin/python3 /www/wwwroot/www.315base.com/py/cls.py


#开机运行脚本
vi /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local


文章评论

0条评论