Centos67安装PyOne(三)

前面已经搞了一天了哈,下班继续搞,当时可以运行的,不过现在不可以了。所有环境配置路径全部报错。
哎看来真的应该用centos7版本的,不过真心不想重装系统,也不想备份还原,再去干一遍wordpress。
继续记录下:

重启之后,由于python重新搞了之后我设置了path参数,所以很多命令用不了。一步一步检查吧。

检查python

[root@centos67-x64 ~]# python -V
Python 2.7.14
#正常

检查web

[root@centos67-x64 ~]# gunicorn
-bash: gunicorn: command not found
[root@centos67-x64 ~]# flask
-bash: flask: command not found
[root@centos67-x64 ~]# 
#都不正常,我不信邪,虽然不懂linux,但是不服

 

flask
flask_sqlalchemy
redis
pymongo
gunicorn==19.3.0
humanize
python_dateutil
requests
markdown
shelljob
eventlet
flask_caching
flask_limiter
Flask-And-Redis
flask_script
pycrypto
requests[security]
urllib3
pyopenssl
#查看了一下所有环境配置requirements.txt

 

 pip install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: flask in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 1)) (1.1.1)
Requirement already satisfied: flask_sqlalchemy in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 2)) (2.4.1)
Requirement already satisfied: redis in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 3)) (3.3.11)
Requirement already satisfied: pymongo in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 4)) (3.9.0)
Requirement already satisfied: gunicorn==19.3.0 in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 5)) (19.3.0)
Requirement already satisfied: humanize in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 6)) (0.5.1)
Requirement already satisfied: python_dateutil in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 7)) (2.8.1)
Requirement already satisfied: requests in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 8)) (2.22.0)
Requirement already satisfied: markdown in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 9)) (3.1.1)
Requirement already satisfied: shelljob in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 10)) (0.5.6)
Requirement already satisfied: eventlet in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 11)) (0.25.1)
Requirement already satisfied: flask_caching in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 12)) (1.7.2)
Requirement already satisfied: flask_limiter in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 13)) (1.1.0)
Requirement already satisfied: Flask-And-Redis in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 14)) (1.0.0)
Requirement already satisfied: flask_script in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 15)) (2.0.6)
Requirement already satisfied: pycrypto in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 16)) (2.6.1)
Requirement already satisfied: urllib3 in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 18)) (1.25.6)
Requirement already satisfied: pyopenssl in /usr/local/python/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 19)) (19.0.0)
Requirement already satisfied: click>=5.1 in /usr/local/python/python2.7/lib/python2.7/site-packages (from flask->-r requirements.txt (line 1)) (7.0)
Requirement already satisfied: Werkzeug>=0.15 in /usr/local/python/python2.7/lib/python2.7/site-packages (from flask->-r requirements.txt (line 1)) (0.16.0)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/python/python2.7/lib/python2.7/site-packages (from flask->-r requirements.txt (line 1)) (1.1.0)
Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/python/python2.7/lib/python2.7/site-packages (from flask->-r requirements.txt (line 1)) (2.10.3)
Requirement already satisfied: SQLAlchemy>=0.8.0 in /usr/local/python/python2.7/lib/python2.7/site-packages (from flask_sqlalchemy->-r requirements.txt (line 2)) (1.3.10)
Requirement already satisfied: six>=1.5 in /usr/local/python/python2.7/lib/python2.7/site-packages (from python_dateutil->-r requirements.txt (line 7)) (1.12.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/python/python2.7/lib/python2.7/site-packages (from requests->-r requirements.txt (line 8)) (2019.9.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/python/python2.7/lib/python2.7/site-packages (from requests->-r requirements.txt (line 8)) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/python/python2.7/lib/python2.7/site-packages (from requests->-r requirements.txt (line 8)) (2.8)
Requirement already satisfied: setuptools>=36 in /usr/local/python/python2.7/lib/python2.7/site-packages (from markdown->-r requirements.txt (line 9)) (41.6.0)
Requirement already satisfied: enum34; python_version < "3.4" in /usr/local/python/python2.7/lib/python2.7/site-packages (from eventlet->-r requirements.txt (line 11)) (1.1.6)
Requirement already satisfied: monotonic>=1.4 in /usr/local/python/python2.7/lib/python2.7/site-packages (from eventlet->-r requirements.txt (line 11)) (1.5)
Requirement already satisfied: dnspython>=1.15.0 in /usr/local/python/python2.7/lib/python2.7/site-packages (from eventlet->-r requirements.txt (line 11)) (1.16.0)
Requirement already satisfied: greenlet>=0.3 in /usr/local/python/python2.7/lib/python2.7/site-packages (from eventlet->-r requirements.txt (line 11)) (0.4.15)
Requirement already satisfied: limits in /usr/local/python/python2.7/lib/python2.7/site-packages (from flask_limiter->-r requirements.txt (line 13)) (1.3)
Requirement already satisfied: cryptography>=2.3 in /usr/local/python/python2.7/lib/python2.7/site-packages (from pyopenssl->-r requirements.txt (line 19)) (2.8)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/python/python2.7/lib/python2.7/site-packages (from Jinja2>=2.10.1->flask->-r requirements.txt (line 1)) (1.1.1)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/local/python/python2.7/lib/python2.7/site-packages (from cryptography>=2.3->pyopenssl->-r requirements.txt (line 19)) (1.0.23)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/python/python2.7/lib/python2.7/site-packages (from cryptography>=2.3->pyopenssl->-r requirements.txt (line 19)) (1.13.2)
Requirement already satisfied: pycparser in /usr/local/python/python2.7/lib/python2.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography>=2.3->pyopenssl->-r requirements.txt (line 19)) (2.19)
#不服气,重装一下,全部都显示已经安装。很郁闷,由于在边远地区,身边也没个懂的人可以问问。

检查插件

[root@centos67-x64 ~]# pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package          Version  
---------------- ---------
certifi          2019.9.11
cffi             1.13.2   
chardet          3.0.4    
Click            7.0      
cryptography     2.8      
dnspython        1.16.0   
enum34           1.1.6    
eventlet         0.25.1   
Flask            1.1.1    
Flask-And-Redis  1.0.0    
Flask-Caching    1.7.2    
Flask-Limiter    1.1.0    
Flask-Script     2.0.6    
Flask-SQLAlchemy 2.4.1    
greenlet         0.4.15   
gunicorn         19.3.0   
humanize         0.5.1    
idna             2.8      
ipaddress        1.0.23   
itsdangerous     1.1.0    
Jinja2           2.10.3   
limits           1.3      
Markdown         3.1.1    
MarkupSafe       1.1.1    
meld3            2.0.0    
monotonic        1.5      
pip              19.3.1   
pycparser        2.19     
pycrypto         2.6.1    
pymongo          3.9.0    
pyOpenSSL        19.0.0   
python-dateutil  2.8.1    
redis            3.3.11   
requests         2.22.0   
setuptools       41.6.0   
shelljob         0.5.6    
six              1.12.0   
SQLAlchemy       1.3.10   
supervisor       3.3.4    
urllib3          1.25.6   
Werkzeug         0.16.0   
wheel            0.33.6   
#查看一下所有,pip安装的环境,没问题。冷静的想一下,决定有两条路可以选,重装系统换成centos7,这是长久办法。
#卸载python,重新修改所有参数。
#睡醒了继续折腾
#换了个思路,把所有路径下的python的依赖包全部干掉,重新安装,看看提示的路径是多少记录一下,以便下次整改
#得到一下报错
  WARNING: The script flask is installed in '/usr/local/python/python2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts gunicorn, gunicorn_django and gunicorn_paster are installed in '/usr/local/python/python2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script chardetect is installed in '/usr/local/python/python2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script markdown_py is installed in '/usr/local/python/python2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

 

#得到变量地址后,直接设个变量带进去试试
[root@centos67-x64 PyOne]# gunicorn
usage: gunicorn [OPTIONS] [APP_MODULE]
gunicorn: error: No application module specified.
#运行没问题,结束一开始的进程,试试重新运行
[root@centos67-x64 PyOne]# cp self_config.py.sample self_config.py
[root@centos67-x64 PyOne]# cp supervisord.conf.sample supervisord.conf
[root@centos67-x64 PyOne]# touch .install
[root@centos67-x64 PyOne]# gunicorn -k eventlet -b 0.0.0.0:34567 run:app
[2019-11-07 10:03:00 +0000] [18992] [INFO] Starting gunicorn 19.3.0
[2019-11-07 10:03:00 +0000] [18992] [INFO] Listening at: http://0.0.0.0:34567 (18992)
[2019-11-07 10:03:00 +0000] [18992] [INFO] Using worker: eventlet
[2019-11-07 10:03:00 +0000] [19006] [INFO] Booting worker with pid: 19006
#结果显示一切正常,原来我的VIM命令不会用直接给改错了导致的那么多麻烦。这次下载到本地添加。
----------------以下为profile文件编辑-----------------------------------------------------
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

pathmunge () {
    case ":${PATH}:" in
        *:"$1":*)
            ;;
        *)
            if [ "$2" = "after" ] ; then
                PATH=$PATH:$1
            else
                PATH=$1:$PATH
            fi
    esac
}


if [ -x /usr/bin/id ]; then
    if [ -z "$EUID" ]; then
        # ksh workaround
        EUID=`/usr/bin/id -u`
        UID=`/usr/bin/id -ru`
    fi
    USER="`/usr/bin/id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
fi

# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
    pathmunge /sbin after
fi

HOSTNAME=`/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
    umask 002
else
    umask 022
fi

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null 2>&1
        fi
    fi
done

unset i
unset -f pathmunge

《Centos67安装PyOne(三)》

项目跑起来,并成功绑定网盘了。

不过不显示文件列表是什么鬼,到后台去抽一眼,发现运行有问题,但是基本都更新啊。

2019-11-07 10:17:29,485 - INFO: [start] getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/影视模块+主题/agmovie/static/agmovie/fonts:/children?expand=thumbnails
/usr/local/python/python2.7/lib/python2.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
2019-11-07 10:17:29,533 - INFO: path:css,origin size:193368,current size:193368--------no change
/usr/local/python/python2.7/lib/python2.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
2019-11-07 10:17:29,556 - INFO: thread Thread-3's status True,qsize 1
2019-11-07 10:17:29,557 - INFO: thread Thread-4's status True,qsize 1
2019-11-07 10:17:29,559 - INFO: thread Thread-5's status True,qsize 1
2019-11-07 10:17:29,564 - INFO: thread Thread-7's status True,qsize 1
2019-11-07 10:17:29,581 - INFO: 
getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/洛宁华泰长岭、列沟竖井技术协议/竖井设备协议/中信重工/列沟竖井:/children?expand=thumbnails 2019-11-07 10:17:29,722 - INFO: path:fonts,origin size:8400,current size:8400--------no change /usr/local/python/python2.7/lib/python2.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning, 2019-11-07 10:17:29,759 - INFO: path:长岭竖井,origin size:8671772,current size:8671772--------no change /usr/local/python/python2.7/lib/python2.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning, 2019-11-07 10:17:29,783 - INFO:
getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/影视模块+主题/agmovie/static/agmovie/css:/children?expand=thumbnails 2019-11-07 10:17:30,083 - INFO: [start] getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/影视模块+主题/agmovie/static/agmovie/js:/children?expand=thumbnails /usr/local/python/python2.7/lib/python2.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning, 2019-11-07 10:17:30,093 - INFO:
getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/影视模块+主题/agmovie/static/agmovie/fonts:/children?expand=thumbnails 2019-11-07 10:17:30,302 - INFO: path:js,origin size:58072,current size:58072--------no change /usr/local/python/python2.7/lib/python2.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning, 2019-11-07 10:17:30,566 - INFO: thread Thread-3's status False,qsize 0 Exception TypeError: TypeError('documents must be a non-empty list',) in <bound method GetItemThread.__del__ of <GetItemThread(Thread-3, stopped daemon 140658669446912)>> ignored 2019-11-07 10:17:30,567 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:30,567 - INFO: error status times:2 2019-11-07 10:17:30,567 - INFO: thread Thread-7's status True,qsize 0 2019-11-07 10:17:30,568 - INFO: error status times:3 2019-11-07 10:17:30,718 - INFO:
getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/影视模块+主题/agmovie/static/agmovie/js:/children?expand=thumbnails 2019-11-07 10:17:30,730 - INFO:
getting files from url https://sunvo-my.sharepoint.cn/_api/v2.0/me/drive/root:/其他群转载/洛宁华泰长岭、列沟竖井技术协议/竖井设备协议/中信重工/长岭竖井:/children?expand=thumbnails 2019-11-07 10:17:31,570 - INFO: thread Thread-4's status False,qsize 0 2019-11-07 10:17:31,574 - INFO: thread Thread-7's status False,qsize 0 2019-11-07 10:17:32,578 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:32,579 - INFO: error status times:2 2019-11-07 10:17:33,581 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:33,581 - INFO: error status times:3 2019-11-07 10:17:34,583 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:34,583 - INFO: error status times:4 2019-11-07 10:17:35,585 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:35,587 - INFO: error status times:5 2019-11-07 10:17:36,589 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:36,589 - INFO: error status times:6 2019-11-07 10:17:37,591 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:37,592 - INFO: error status times:7 2019-11-07 10:17:38,593 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:38,594 - INFO: error status times:8 2019-11-07 10:17:39,596 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:39,596 - INFO: error status times:9 2019-11-07 10:17:40,598 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:40,599 - INFO: error status times:10 2019-11-07 10:17:41,601 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:41,602 - INFO: error status times:11 2019-11-07 10:17:42,604 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:42,605 - INFO: error status times:12 2019-11-07 10:17:43,607 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:43,607 - INFO: error status times:13 2019-11-07 10:17:44,609 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:44,610 - INFO: error status times:14 2019-11-07 10:17:45,611 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:45,612 - INFO: error status times:15 2019-11-07 10:17:46,614 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:46,614 - INFO: error status times:16 2019-11-07 10:17:47,616 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:47,616 - INFO: error status times:17 2019-11-07 10:17:48,618 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:48,619 - INFO: error status times:18 2019-11-07 10:17:49,620 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:49,621 - INFO: error status times:19 2019-11-07 10:17:50,623 - INFO: thread Thread-5's status True,qsize 0 2019-11-07 10:17:50,623 - INFO: error status times:20 2019-11-07 10:17:50,624 - INFO: force kill thread:Thread-5 2019-11-07 10:17:50,624 - INFO: B:/ all thread stop! 2019-11-07 10:17:50,626 - INFO: all users update status is complete 2019-11-07 10:17:50,627 - INFO: update file success!

我那个去,是不是ssl需要单独配置还是什么鬼?试试换个地址更新一下。配置ssl终于成功了。

强烈建议,不要钻牛角尖,改用centos7去调试把。OVER,重做系统,适应社会发展潮牛。

《Centos67安装PyOne(三)》

发表回复