Fork me on GitHub

Python+Selinum环境配置

apt-get remove 会删除软件包而保留软件的配置文件

apt-get purge 会同时清除软件包和软件的配置文件 

 


virtualenv -p /usr/local/bin/python3.6 --no-site-packages venv

source my_project/bin/activate

deactivate 退出

 

 

 supervisor 安装配置: 

apt install supervisor 

[program:ind]
command=python3 /root/robot/IND/start.py
stderr_logfile=/root/robot/logs/ind/err.log
stdout_logfile=/root/robot/logs/ind/out.log
autostart=true
autorestart=true
user=root

主的配置:
[inet_http_server]
port=0.0.0.0:9001
username=admin
password=12345
exitcodes=1


supervisorctl stop all

Error Another program is already listening on a port that one of our HTTP servers is configured to use

ps -ef | grep supervisord

kill -9

supervisord -c /etc/supervisor/supervisord.conf -n -edebug

 https://www.armyja.cn/setup-supervisor-based-on-virtialenv/

 

 

linux配置selinum环境:
https://blog.csdn.net/dd_lucky/article/details/79429421

 

pip3 freeze > ./requirements/requirements.txt

pip3 install -r requirements.txt

 

 

-------------------------centeos编译安装python,配置selinum环境------------- 

https://blog.csdn.net/qq_36750158/article/details/80609857 

 

========================================================

=======https://segmentfault.com/a/1190000012923757


yum install -y ncurses-libs zlib-devel mysql-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz

xz -d Python-3.6.2.tar.xz

tar -xvf Python-3.6.2.tar

cd Python-3.6.2/

./configure --prefix=/usr/local/python3.6 --enable-optimizations

make

make install

# ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python3
# ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip3

# cd /usr/bin
# ls -al python*


pip3 install virtualenv

virtualenv -p /usr/bin/python3 --no-site-packages venv

ln -s /usr/local/python3.6/bin/virtualenv /usr/bin/virtualenv  

 

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

yum localinstall ./google-chrome-stable_current_x86_64.rpm

wget https://chromedriver.storage.googleapis.com/78.0.3904.105/chromedriver_linux64.zip

unzip chromedriver_linux64.zip

mv chromedriver /user/bin

 

 

=====================================

使用selinum配置确实麻烦,可以使用pyppeteer

解析html使用pyquery

 

posted @ 2019-10-21 23:48  迁梦余光  阅读(583)  评论(0编辑  收藏  举报