我爱编程

centos7上安装portia

2018-07-24  本文已影响0人  叫我小名

使用阿里源

删除阿里内网地址#

cp -fr /etc/yum.repos.d /etc/yum.repos.d.bak
rm -f /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
sed -i '/aliyuncs.com/d' /etc/yum.repos.d/*.repo

装python3.6和pip

yum install -y python36
rm -fr /usr/bin/python
ln -s /usr/bin/python3.6 /usr/bin/python
rm -fr /usr/bin/python2
ln -s /usr/bin/python2.7 /usr/bin/python2

修改yum

vi /usr/bin/yum
vi /usr/libexec/urlgrabber-ext-down
改第一行python为python2

pip install

curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip -V  #查看pip版本

yum install -y gcc

pip install mysqlclient==1.3.12问题:
wget https://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.60-1.el7.x86_64.rpm
yum install -y python36-devel.x86_64
rpm -ivh MySQL-devel-5.5.34-1.el6.x86_64.rpm
cp /usr/lib64/mysql/* /usr/lib64/

from PyQt5.QtGui import QKeyEvent

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

No module named 'PyQt5.QtWebKit'

yum install qtwebkit -y

手动安装pyqt5, 需要安装最新的版本

yum install qt5-qtquickcontrols qt5-qtdeclarative-devel -y
yum install gcc gcc-c++ python-devel -y
yum install mesa-libGL.x86_64 -y

先安装sip

wget https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.11/sip-4.19.11.tar.gz
tar xzvf sip-4.19.11.tar.gz
cd sip
python configure.py
make
make install

安装pyqt5

yum install qt5-qtbase-devel -y
wget https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.11.2/PyQt5_gpl-5.11.2.tar.gz
tar xzvf PyQt5_gpl-5.11.2.tar.gz
cd PyQt5_gpl-5.11.2
python configure.py --qmake=/usr/bin/qmake-qt5 --verbose
make all
make install

OSError: Can not find Xvfb. Please install it and try again.

yum install Xvfb

libEGL warning: DRI2: failed to open swrast

yum install mesa-dri-drivers -y

cd /data/www/html/python-data-portia-web

配置nginx

yum install nginx
cp nginx/* /etc/nginx
替换/etc/nginx/nginx.conf里面的/app字符串为/data/www/html/python-data-portia-web

path='/data/www/html/python-data-portia-web/portia_server:/data/www/html/python-data-portia-web/slybot'
export PYTHONPATH="$path"
nohup python portia_server/manage.py runserver &
nohup python slyd/bin/slyd -p 9002 -r /data/www/html/python-data-portia-web/portiaui/dist &

访问ip:9001

上一篇下一篇

猜你喜欢

热点阅读