ubuntu 安装pyqt IDE使用eric 辛酸史
//后面解决了这个问题 当安装完sip和pyqt后直接用apt 来安装eric就不会出错了
不得不说,现在学习Python是最不要的时机,原本是冲着Python简洁来的,现在由于语言发展的瓶颈,不得不划分了两类不兼容的版本。
于是乎,奔着我不下地狱谁下地狱的劲开始了,在这里eric5是我们的Python IDE,PyQt4是Qt界面开发的类。而QT是踏平台的图形用户界面程序,如果在Python 调用,需要负责调用C/C++模块的Python工具-SIP,而Qscintilla2是连接编译器和Python的接口,所以一套完整的开发环境需要安装以上这些。
这里以安装Python3开发环境为例,其中最为要注意的问题就是要版本问题。Python3需要支持Python3的相应的类库。
安装顺序:
Python3.3
下载网址:http://www.python.org/downloads/
快速下载;http://www.python.org/ftp/python/3.3.5/Python-3.3.5rc1.tar.xz
sip4.15
下载网址:http://www.riverbankcomputing.co.uk/software/sip/download
快速下载:http://sourceforge.net/projects/pyqt/files/sip/sip-4.15.4/sip-4.15.4.tar.gz
PyQt4
下载网址:http://www.riverbankcomputing.co.uk/software/pyqt/download
快速下载:http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.3/PyQt-x11-gpl-4.10.3.tar.gz
Qscintilla2
下载网址:http://www.riverbankcomputing.co.uk/software/qscintilla/download
快速下载:http://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.8/QScintilla-gpl-2.8.tar.gz
Eric5
下载网址:http://eric-ide.python-projects.org/eric-download.html
快速下载 :http://sourceforge.net/projects/eric-ide/files/eric5/stable/
Eirc最重要的两句说明:eric4 includes a plugin system, which allows easy extension of the IDE functionality with plugins downloadable from the net.
Current stable versions are eric4 based on Qt4 and Python 2 and eric5 based on Python 3 and Qt4.
Eric4包含了插件系统,其可以允许我们直接通过网络下载来扩展我们的IDE。
目前的稳定版Eric4是基于QT4和Python2的,而Eric5是基于Python3和QT4的。
安装Python3
由于Linux系统默认基本都安装了Python2,所以很多的应用都会与之相关,而用Python3又不与Python2不兼容,会造成很多应用莫名的错误,所以我们安装使两者并存:
- tar -xavf Python-3.3.5rc1.tar.xz
- cd Python-3.3.5rc1.tar.xz
- sudo mkdir /usr/local/python3
- ./configure --prefix=/usr/local/python3
- sudo make && sudo make install
- ln -s /usr/local/python3/bin/python3 /usr/bin/python3
- 最后分别输入python 和python3测试
安装sip4.15
- tar -xavf sip-4.15.4.tar.gz
- cd sip-4.15.4
- python3 configure.py
- make
- sudo make install
- 这里我们在安装里要注意查找安装参数,比如默认安装路径等信息,命令是:python3 configure.py -h
安装 PyQt4
- tar -xavf PyQt-x11-gpl-4.10.3.tar.gz
- cd PyQt-x11-gpl-4.10.3
- python3 configure.py
- make
- sudo make install
安装Qscintilla2
- tar -xzvf QScintilla-gpl-2.8.tar.gz
- cd QScintilla-gpl-2.8
- cd Qt4Qt5
- qmake qscintilla.pro
- make
- make install
- cd ../Python
- python configure.py
- make
- sudo make install
- cd ../designer-Qt4Qt5
- qmake designer.pro
- make
- sudo make install
安装Eric5
- tar -xavf eric5-5.4.0.tar.gz
- cd eric5-5.4.0
- sudo python3 install.py
一般大家常会在这一步碰到Unable to Import "PyQt4"
而前面感觉装下来挺顺利,怎么会找不到PyQt4模块呢
这里最主要的原因就是我们前面安装的PyQt4用的sip版本不对,因为PyQt4默认的安装位置是/usr/share/sip/PyQt4
我们可以发现很多.sip文件,都是从C++转过来的Qt库,我们在这里可以在python2和python3下运行 from PyQt4.QtCore import *
会发现python2下正常,而python3下不正常,就是因为系统中存在已安装的老版本sip,通过输入
说明默认就是使用了老版本,那么如何解决呢?
即在QScintilla2和PyQt4时可以指定使用什么,可以通过-h命令查看
即在所有用configure.py配置的文件 换成如下命令:
python3 configure.py --sip=/usr/local/python3/bin/sip 自己指定
总结:
在安装应用时,个人推荐使用源码安装,因为这样可以更的控制安装的环境,而且这样得到的软件更新,可能会修正很多bug。
除非是整套的依赖的软件都在software center存在,最后会很容易出现某一个库不匹配,残留文件也会影响源码安装。
Python的库路径设置,可以通过在环境变量中配置,PYTHONPATH来永久设置,也可以通过
import sys
sys.path.append('路径')
来暂时添加
通过print(sys.path)来查看 配置的环境。
最后来张图:
--------------------------完美分割线-----------------------------
1、安装sip
tar xvf sip-4.14.tar.gz
cd sip-4.14/
python configure.py
make
make install
2、安装qmake及qt4
sudo apt-get install libqt4-devlibqt4-debug libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designerqt4-qtconfig
3、安装PYQT4
tar xf PyQt-x11-gpl-4.9.5.tar.gz
cd PyQt-x11-gpl-4.9.5/
python configure.py
make
make install
4、安装QScintilla
tar xvf QScintilla-gpl-snapshot-2.6.3-80df6cc89bae.tar.gz
cd QScintilla-gpl-snapshot-2.6.3-80df6cc89bae/
cd Qt4Qt5/
qmake qscintilla.pro
make
sudo make install
cd ..
cd Python/
sudo python configure.py
make
sudo make install
cd ..
cd designer-Qt4/
qmake designer.pro
make
sudo make install
5、安装Eric4
tar xvf eric4-4.5.7.tar.gz
tar xvf eric4-i18n-zh_CN.GB2312-4.5.7.tar.gz
cd eric4-4.5.7/
python install.py
6、启动Eric4
/usr/local/bin/eric4
Eric4配置参考:
初次打开Eric4,一个配置窗口会首先出现,这里可以简单的配置一下(或者以后在Settings – Preferences中配置也可以):
在Eidtor下面,
点击APIs,勾选上”Compile APIs automatically”,选择Language为”Python”,点击Add from installed APIs,选择eric4.api或其它你需要的APIs。然后点击下面的”Compile APIs”,这里会需要点时间。结束后点Apply。
然后点击Autocompletion,里面的三个都勾选上。
然后再点击QScintilla,选”from Document and API files”。
Apply 然后 OK。
-----------------------------------------------------------
1) Install python3.2 using the software centre
2) Open terminal and type
sudo apt-get install python3.2-dev libqt4-dev g++ python-qt4 qt4-dev-tools python-qt4-dev pyqt4-dev-tools
3) Download SIP http://www.riverbankcomputing.co.uk/...e/sip/download
4) Download PyQt http://www.riverbankcomputing.co.uk/.../pyqt/download
5) Untar both downloads
6) cd into sip folder
7) run
python3.2 configure.py;make;sudo make install
8] cd into pyqt folder
9) run
python3.2 configure.py;make;sudo make install
10) test if it works like neurobot says in first post.
ubuntu 安装pyqt IDE使用eric 辛酸史相关推荐
- Ubuntu 安装 Eclipse IDE
Ubuntu 安装 Eclipse IDE The Platform for Open Innovation and Collaboration http://www.eclipse.org/ 编辑 ...
- IDE之Eric:Python的IDE之eric的简介、安装、使用方法之详细攻略
IDE之Eric:Python的IDE之eric的简介.安装.使用方法之详细攻略 目录 Eric的简介 Eric的安装 1.先下载文件 2.再编译安装 python3.6.4安装
- python ide安装_python IDE Eric6安装
在Windows下安装Eric6 IDE, 提示没有安装pyqt5, 然后在Window下面通过easy_install 安装了pip, 然后通过pip install python-qt5, 更新了 ...
- Linux发行版上安装Netbeans IDE的各种方法
在本文中,您将学习在Ubuntu和其他Linux发行版上安装Netbeans IDE的各种方法. NetBeans是一个开源的集成开发环境,具有良好的跨平台支持.该工具已被Java和C/C ++开发社 ...
- linux使用交叉工具链产生的程序怎么下载到mini2440里,Ubuntu安装ARM架构GCC工具链(ubuntu install ARM toolchain)最简单办法...
一.安装ARM-Linux-GCC工具链 只需要一句命令: sudo apt-get install gcc-arm-linux-gnueabi 前提是你的Ubuntu系统版本是官网支持的最新的版本, ...
- ubuntu 安装Gogland
ubuntu 安装Gogland 一,安装 把linux版本的Gogland下载后.在需要安装的地方解压缩,即完成安装,但是还需要一些配置,以下假设你已经安装好了go语言 二 安装在当前用户目录下 比 ...
- Ubuntu安装Arduino
Ubuntu安装Arduino 下载Arduino 这里提供Arduino的下载链接: https://www.arduino.cc/en/Main/Software 点击进入官网后选择需要的版本进行 ...
- ubuntu 安装GPU黑屏 修改GRUB_Ubuntu 18.04 安装笔记
概述:Ubuntu 18.04 的安装配置笔记, :two_hearts:. 简介:基础使用环境的搭建,暂定目标为一篇文章解决大部分疑问. 协议:本文章使用 CC BY-NC-SA 4.0 协议(转载 ...
- AspNetCore3.1 在CentOS 用docker发布 踩坑辛酸史
AspNetCore3.1 在CentOS 用docker发布 踩坑辛酸史 发布场景:windows上虚拟机 CentOS(7.8)环境 创建AspNetCore3.1 项目,加入Docker支持 首 ...
- Ubuntu安装Eclipse,maven
Ubuntu安装JDk tar -zxvf jdk-7u80-linux-i586.tar.gz mv jdk1.7.0_80 jdk1.7 vim ~/.bashrc ##JAVA export ...
最新文章
- Java中泛型的各种使用
- css3 loading 效果1
- ax3000 梅林_梅林甘蔗下种忙 古法红糖“熬”成致富新产业
- hbase 命令_HBase原理与实践 | 生产环境上线前真的优化过吗?
- php mvc vue 调用js函数_js 匿名函数自调用
- Rust : 红楼梦一书中文字符的统计
- Druid连接池简单配置
- 数学建模竞赛题目 学校食堂就餐问题
- 深圳大数据学习:怎样进行大数据的入门级学习?
- python图书库存管理系统_基于Odoo的物流库存管理系统的设计(Python)
- SVN客户端——SmartSVN功能详解
- 从0到1搭建大数据平台之开篇
- Moebius for SQL Server
- 推荐网络带宽控制软件Netlimiter
- 翻译-你必须知道的28个HTML5特征、窍门和技术
- Lora模块(SX1278)
- 编码:隐匿在计算机软硬件背后的语言pdf-Code:The Hidden Language of Computer Hardware and Software-Charles Petzold-pdf
- 简述使用混合传递参数时的基本原则_过程控制系统与仪表习题答案 -
- Java double 保留一个小数、理解BigDecimal、Java解决精度问题
- ele-ui 里面的分页操作