You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.7 KiB

## 一、修改系统的PIP源
### $Linux/Mac$ $os$ 环境
配置文件位置在 `~/.pip/pip.conf`(如果不存在创建该目录和文件):
```shell
mkdir ~/.pip
vi ~/.pip/pip.conf
[global]
index-url = https://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com
```
### 查看$python3$版本
```
python3 --version
```
`Python 3.7.9` [银河麒麟V10,并不免费,不是以后的首选。免费的还是用华为欧拉]
### 查看镜像地址:
```shell
pip3 config list
```
输出
```shell
global.index-url='https://pypi.douban.com/simple'
install.trusted-host='pypi.douban.com'
```
## 二、安装各种类库
```shell
python3 -m pip install --upgrade pip
pip3 install gevent
pip3 install python-docx
pip3 install python-pptx
yum install postgresql-devel*
python3 -m pip install psycopg2-binary
pip3 install flask
pip3 install snapshot-selenium
pip3 install pyecharts
pip3 install petl
pip3 install DBUtils
yum install -y python3-pip
```
## 三、启动$Start.py$
#### 后台
```shell
cd /usr/local/ReplaceOffice
nohup python3 -u Start.py > Start.log 2>&1 &
```
#### 前台
```shell
cd /usr/local/ReplaceOffice
python3 Start.py
```
## 四、测试
```shell
http://192.168.100.100:8888/Mars/exportDoc?year=2020
http://192.168.100.100:8888/Mars/exportPpt?year=2020
http://12:8888/Mars/exportDoc?year=2019
http://192.168.100.100:8888/Mars/exportPpt?year=2019
```
## 五、异常处理
### 1、安装$net-tools$
```shell
yum install net-tools -y
```
### 2、查看端口情况
```shell
netstat -anp | grep 8888
```
### 3、查询进程
```shell
ps -ef | grep python3
```
<font color='blue' size=4><b>$enjoy$~</b></font>