python3.4 + numpy + scipy + matplotlib + PyQt5.4.0
Ubuntu14.04(32位)+ Python3.4 + Qt5.4.0 + PyQt5.4.0+sip4.18-1
为了连接MySQL数据库,需要安装连接MySQL的驱动程序:
sudo apt-get install libqt4-sql-mysql
有一些项目中,还需要画一些数据曲线和统计图表等,而第三方的QWT库提供了这些功能。
sudo apt-get install libqwt5-qt4 libqwt5-qt4-dev
最后,关于集成开发环境我觉得QDevelop很不错,它跟Qt Designer结合的很好,而且有提示类成员函数的功能。运行以下命令安装:sudo apt-get install qdevelop
这样,使用Qdevelop编写代码和编译、调试,使用Qt Designer设计界面,开发效率较高。
sudo easy_install pip
sudo: easy_install: command not found on Debian/Ubuntu: =>
sudo apt-get install python-setuptools
Also, for python3, use easy_install3 and python3-setuptools
sudo apt-get install python3-setuptools
sudo easy_install3 pip
Installing pip script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Installing pip3.4 script to /usr/local/bin
sudo pip3.4 install virtualenvwrapper
which virtualenvwrapper.sh
which virtualenvwrapper_lazy.sh
mkdir ~/.virtualenvs
add the configuration to your ~/.bashrc file.
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.4
add a command to the ~/.zshrc to run the activation script when my shell starts.
source `which virtualenvwrapper_lazy.sh`
which python3.4
/usr/bin/python3.4
mkvirtualenv testpy3 -p /usr/bin/python3.4
安装SIP
SIP是python调用C/C++库的必备模块。因此SIP是PyQt的依赖工具,安装PyQt之前必须先安装对应版本的SIP。PyQt编译时使用的SIP版本必须与python默认调用的SIP保持一致!否则python中是无法调用PyQt的。这里我们使用最新的sip-4.18.1
Ubuntu14.04中貌似是自带4.15版的SIP(or自己安装python扩展是自动安装的)。终端输入:
sip -V
查看已安装SIP版本,如果存在其他版本,请查看python3的dist-packages目录下是否存在sip相关文件。如果存在将其删除:
sudo rm /usr/lib/python3/dist-packages/sip*
查看二者显示的版本是否一致。如不一致,需要重新执行上述删除过程和安装过程。版本不一致将意味着后面编译PyQt所使用的SIP和Python3调用的SIP的不一致,导致在Python3中调用PyQt的相关模块(from PyQt5 import QtCore)出现类似如下错误:
the sip module implements API v11.0 but the PyQt5.QtCore module requires API v11.1
reverting to sip 4.18-1 solved the issue for qt5, but py27-pyqt4 requires SIP v4.19.0 or later
(testpy3)$ cd sip-4.18-1
(testpy3)$ python configure.py
ERROR=>
siplib.c:20:20: fatal error: Python.h: No such file or directory
FIX=>
Looks like you haven't properly installed the header files and static libraries for python dev. Use your package manager to install them system-wide.
For apt (ubuntu, debian...):
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
For yum (centos, redhat, fedora...)
sudo yum install python-devel
(testpy3)$ sudo make
(testpy3)$ sudo make install
sip -V
4.18-1
python
>>>import sip
>>>print(sip.SIP_VERSION_STR)
4.18-1
$ workon testpy3
(testpy3)$ deactivate
安装qt依赖的包
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
ERROR=>Qt Designer plugin disabled because Python library couldn't be found
reinstall Qt by run=>
sudo ./qt-opensource-linux-x86-5.4.0.run
/opt/Qt5.4.0
export QTDIR=/opt/Qt5.4.0/5.4/gcc
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib
$ workon testpy3
$ cd /home/simon/Downloads/pypackages/PyQt-gpl-5.4
python configure.py
The PyQt5 Python package will be installed in
/home/simon/.virtualenvs/testpy3/lib/python3.4/site-packages.
sudo make
ERROR=>../qpy/QtCore/qpycore_chimera.cpp:503:22: error: ‘pyqt5ClassTypeDef’ was not declared in this scope
FIX=>reverting to sip 4.18-1 solved the issue for qt5, but py27-pyqt4 requires SIP v4.19.0 or later
sudo make install
ERROR=>
pyuic5: File format not recognized
make: [install_pyuic5] Error 1 (ignored)
Just ignore it. Your installation is fine. Open Terminal:
$python
>>> import PyQt5.Qt
if there is no error show up, you are done.
$ workon testpy3
$ cd /home/simon/Downloads/pypackages/PyQt-gpl-5.4
python configure.py -verbose --qmake /opt/Qt5.4.0/5.4/gcc/bin/qmake --sip-incdir=/usr/include/python3.4m
These PyQt5 modules will be built: QtCore, QtNetwork, QtXml, QtXmlPatterns,QtDBus.
bing search=>[PyQt5 QtGui]
Look at the output of configure.py, there should be a line:
These PyQt5 modules will be built: QtCore, QtGui, QtHelp, QtMultimedia, QtMultimediaWidgets, QtNetwork, QtOpenGL, QtPrintSupport, QtQml, QtQuick, QtSql, QtSvg, QtTest, QtWebKit, QtWebKitWidgets, QtWidgets, QtXml, QtXmlPatterns, QtDesigner, QtDBus, _QOpenGLFunctions_2_0, QtSensors, QtSerialPort, QtX11Extras, QtBluetooth, QtPositioning, QtQuickWidgets, QtWebSockets, Enginio, QtWebChannel, QtWebEngineWidgets
If this list is considerably shorter, missing QtGui etc, your installation may be missing OpenGL. In my case...
sudo apt-get install freeglut3-dev
python configure.py -verbose --qmake /opt/Qt5.4.0/5.4/gcc/bin/qmake --sip-incdir=/usr/include/python3.4m --verbose
sudo make
sudo make install
############################################################
cd /home/simon/.virtualenvs/testpy3/lib/python3.4/site-packages/PyQt5
Enginio.so QtGui.so QtPrintSupport.so QtSql.so QtWebSockets.so
__init__.py QtHelp.so QtQml.so QtSvg.so QtWidgets.so
_QOpenGLFunctions_2_0.so QtMultimedia.so QtQuick.so QtTest.so QtX11Extras.so
QtBluetooth.so QtMultimediaWidgets.so QtQuickWidgets.so QtWebChannel.so QtXmlPatterns.so
QtCore.so QtNetwork.so QtSensors.so QtWebEngineWidgets.so QtXml.so
QtDBus.so QtOpenGL.so QtSerialPort.so QtWebKit.so uic
QtDesigner.so QtPositioning.so Qt.so QtWebKitWidgets.so
############################################################
from PyQt5.QtCore import *
from PyQt5.QtGui import *
git clone git://github.com/scipy/scipy.git scipy
git clone git://github.com/numpy/numpy.git numpy
最好不用开发版本
sudo apt-get install gfortran
#############普通安装#######################################
cd进setuptools-36.2.0的目录
$python3 setup.py build
$sudo python3 setup.py install
import setuptools
cd进numpy-1.13.1的目录
$python3 setup.py build --fcompiler=gnu95
$sudo python3 setup.py install --prefix=/usr/local
cd进scipy-0.19.1的目录
$python3 setup.py build --fcompiler=gnu95
$sudo python3 setup.py install --prefix=/usr/local
#############virtualenv安装#######################################
(testpy3)$sudo pip3.4 install numpy
=>/usr/local/lib/python3.4/dist-packages
(testpy3)$pip3.4 install numpy
=>/home/simon/.virtualenvs/testpy3/lib/python3.4/site-packages
[with or without sudo,install location differs]
(testpy3)$ python
import numpy
print(numpy.__version__)
print(numpy.__file__)
quit()
(testpy3)$pip3.4 install scipy
import scipy
print(scipy.__version__)
print(scipy.__file__)
quit()
安装matplotlib相对复杂一些
需要先安装其依赖的包libpng和freetype
sudo apt-get install libpng-dev
sudo apt-get install libfreetype6-dev
(testpy3)$pip3.4 search matplotlib
(testpy3)$pip3.4 install matplotlib
import matplotlib
print(matplotlib.__version__)
print(matplotlib.__file__)
quit()
(testpy3)$pip3.4 install PyOpenGL
(testpy3)$pip3.4 install pyqtgraph
相关推荐
**PyQt5-5.4-gpl-Py3.4-Qt5.4.0-x64** 这个标题指的是一个特定版本的PyQt5库,适用于64位(x64)系统,基于Python 3.4,并且是遵循GPL(GNU General Public License)开源协议的。PyQt5是Qt5框架与Python编程语言的...
PyQT5 For Python 3.4
PyQt5-5.4-gpl-Py3.4-Qt5.4.0-x32.exe
win10+Qt5.4.0 MinGW 32bit+ffmpeg+rtsp 示例。本代码整理来自http://www.qtcn.org/bbs/read-htm-tid-56392.html, 由于本人直接下载原作者文件不能成功运行,现将整理好的给大家借鉴。构建成功后,需要将/DLL目录下...
linux-image-5.4.0-18-generic_5.4.0-18.22_amd64.deb
linux-cloud-tools-5.4.0-152-generic_5.4.0-152.169~18.04.1_amd64.deb
linux-hwe-5.4-headers-5.4.0-152_5.4.0-152.169~18.04.1_all.deb
linux-headers-5.4.0-152-generic_5.4.0-152.169~18.04.1_amd64.deb
LED驱动:GEC6818开发板上的灯驱动 ...(1)把我给的5.4.0的编译器拷贝到家目录,然后解压 tar -xf arm-linux-gnueabi-5.4.0.tar.xz (2)配置一下环境变量 export PATH=你的新的arm-linux-gcc所在的路径:$PATH //一次性的
linux-headers-5.4.0-18-generic_5.4.0-18.22_amd64.deb
《Python库:深入理解python-openstackclient-5.4.0》 在IT行业中,Python以其简洁、易读的语法和强大的库支持成为了开发者们的首选语言之一。在云计算领域,OpenStack是一个开源的云操作系统,它提供了一整套工具...
linux-modules-5.4.0-18-generic_5.4.0-18.22_amd64.deb
在本文中,我们将深入探讨如何使用Visual Studio 2010(VS2010)与QT 5.4.0框架构建一个支持多文档的编辑器应用。这个项目是根据《Qt及Qt Quick开发实战精解》这本书中的示例进行实现的。首先,我们来了解这两个关键...
linux-modules-5.4.0-152-generic_5.4.0-152.169~18.04.1_amd64.deb
1. PyQt5-5.4-gpl-Py3.4-Qt5.4.0-x64.exe:这是一个PyQt5的安装包,适用于Python 3.4的64位版本。PyQt5是PyQt的一个较新版本,它包含了Qt库的Python绑定,支持多种功能,如窗口管理、布局管理、图形视图、网络编程等...
linux-headers-5.4.0-18_5.4.0-18.22_all.deb
1. **SOAP协议**:SOAP是一种基于XML的协议,用于在Web上交换结构化和类型化的信息。它允许应用程序通过HTTP、HTTPS等传输协议进行通信,使得数据交换变得简单且可靠。在使用SoapUI时,你可以创建、发送和接收SOAP...
qt-opensource-windows-x86-msvc2013_64_opengl-5.4.0.exe
VS2010+Qt5.4.0 环境搭建(离线安装)-附件资源
最近要降级使用5.4.0,mingw的Qt安装程序,发现官网高版本的下载还方便,低版本的都使用集合的方式下载,感觉很不方便,废了好大劲才找到,分享给大家,仍然需要低版本Qt的可以来取。