ubuntu16.04 安装 Eric6

来源:互联网 发布:数据分析 excel 编辑:程序博客网 时间:2024/05/29 15:05

从安装qt,到安装qtpy,到安装Eric6,这是一个很痛苦的过程。总是会有一大段的错误,然后在网上各种搜索,然后去改,然后还是有新的错误,又去找答案,一直重复,我都快崩溃了。最后,终于,找到这一篇博客:http://blog.csdn.net/suxiang198/article/details/52042526 。这篇博客解决了大部分坑,不过到后面部分还是出现了问题,安装不上去。最后,终于在 Eric6官网 ,找到了终极答案:
原文:

  • “nstallation using PyQt5 wheels
    Installing eric6 and its pre-requisites is easy using the PyQt5 Python wheels. In order to have access to the suite of Qt tools and documentation it is recommended to install the Qt development environment because these tools are not part of the PyQt5 wheels.
    Download the Qt online installer from the Qt download site.
    Install Qt by executing the installer.
    Install the eric6 pre-requisites (PyQt, sip and QScintilla) by entering this command in a shell / command window:
    pip install qscintilla
    or
    pip3 install qscintilla
    This will install QScintilla and all dependencies, which are PyQt5 and sip.
    Install eric6 and configure the path to the Qt tools on the Qt page of the configuration dialog.
    Once the eric6 IDE is started the Qt documentation may be loaded into the eric web browser via the Settings ➡ Mange Qt Help Documents menu entry. Note that the documentation (Python/Qt/PyQt) is available in QtHelp format as of November 2016 as documentation plug-ins. In order to use this feature, eric 16.11 or newer needs to be installed.”

  • 翻译过来就是:
    PyQt5车轮安装
    安装eric6及其先决条件很容易使用PyQt5 Python车轮。为了访问Qt工具和文档套件,建议安装Qt开发环境,因为这些工具不是PyQt5轮的一部分。
    从Qt下载网站下载Qt在线安装程序。
    通过执行安装程序来安装Qt。
    通过在shell /命令窗口中输入此命令来安装eric6先决条件(PyQt,sip和QScintilla):
    pip install qscintilla
    或者
    pip3 install qscintilla
    将安装QScintilla和所有依赖关系,即PyQt5和sip。
    安装eric6并在配置对话框的Qt页面上配置Qt工具的路径。
    一旦启动了eric6 IDE,Qt文档可能会通过Settings ➡ Mange Qt Help Documents 菜单项加载到eric Web浏览器中。请注意,截至2016年11月,文档(Python / Qt / PyQt)以QtHelp格式提供,作为文档插件。为了使用此功能,需要安装eric 16.11或更高版本。

思就是说,安装Eric6的步骤是:

1.安装Qt

2.安装eric6的条件(PyQt,sip和QScintilla)

3.安装eric6并在配置对话框的Qt页面上配置Qt工具的路径

(前提是已经安装好python3.5 )

具体步骤如下:
- 安装OpenGL的库:

sudo apt-get install mesa-common-dev  sudo apt-get install libglu1-mesa-dev -y 

-安装python模块

sudo apt-get install python3-dev

-安装QT
从官网下载,https://www.qt.io/developers/

-配置qmake环境变量,假如
我的Qt5.7.0安装在/home/ethan下,那么,在/home/ethan/Qt5.7.0/5.7/gcc_64/bin/下有qmake。
安装完成后用下面的命令配置一下PATH,在当前用户主目录下的.bashrc (or .zshrc)文件中加入:

export QTDIR=/home/ethan/Qt5.7.0/5.7/gcc_64/export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${QTDIR}/libexport PATH=${QTDIR}/bin:${PATH}

-安装PyQt,sip和QScintilla:

pip3 install qscintilla或者pip install qscintilla

-安装 Eric6
官网下载:https://eric-ide.python-projects.org/eric-download.html
解压安装:

tar -zxvf eric6-6.1.7.tar.gzcd eric6-6.1.7  sudo python3 install.py

Eric6j这就安装好了。过程中,也遇到错误,当执行

$: pip3.5 install QScintilla

时,发现错误:
PermissionError: [Errno 13] 权限不够: '/usr/local/lib/python3.5/dist-packages/sip.so
真相是我在/usr/local/lib/python3.5/dist-packages/目录下根本就没有找到sip.so,不过我通过文件搜索,在/usr/lib/python3/dist-packages/目录下找到了这个sip.so,于是,我就做了一个软链接:
sudo ln -s /usr/lib/python3/dist-packages/sip.so /usr/local/lib/python3.5/dist-packages/sip.so
然后,在执行:sudo pip3 install QScintilla ,终于就生效里了

在启动Eric6时,不要用下面的代码来启动,会报错:

sudo eric6

要使用下面的代码来启动Eric6:

eric6
  • 然后就是打开eric6的各种配置。
    eric6安装结束。

感谢‘suxiang198’的博客

0 0