Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1790088
  • 博文数量: 297
  • 博客积分: 285
  • 博客等级: 二等列兵
  • 技术积分: 3006
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-06 22:04
个人简介

Linuxer, ex IBMer. GNU https://hmchzb19.github.io/

文章分类

全部博文(297)

文章存档

2020年(11)

2019年(15)

2018年(43)

2017年(79)

2016年(79)

2015年(58)

2014年(1)

2013年(8)

2012年(3)

分类: Python/Ruby

2018-08-13 19:19:18

本来使用sublime text3也可以做python的IDE,但是我也想试试pyzo。
安装的过程很和平。没有任何报错

点击(此处)折叠或打开

  1. apt-get install pyzo
但是一启动就报错.

点击(此处)折叠或打开

  1. pyzo
  2. Started our command server
  3. Segmentation fault
查看/var/log/messages就看到这么一行

点击(此处)折叠或打开

  1. Aug 13 17:48:18 kali kernel: [14934.509890] pyzo[4410]: segfault at 0 ip 00007f8688607561 sp 00007fff914d47b0 error 6 in QtCore.cpython-36m-x86_64-linux-gnu.so[7f86884aa000+161000]

思考了下,决定从这个.so(Shared Object)入手。
先找找这个文件在哪里。

点击(此处)折叠或打开

  1. locate QtCore.cpython-36m-x86_64-linux-gnu.so
  2. /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-36m-x86_64-linux-gnu.so
  3. /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so
有点意思,应该是pyqt5和pyqt4都提供了这个文件。确认下提供这个文件的包名。

点击(此处)折叠或打开

  1. dpkg -S /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-36m-x86_64-linux-gnu.so
  2. python3-pyqt4: /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-36m-x86_64-linux-gnu.so
  3. dpkg -l |grep pyqt
  4. ii  python-pyqt5                                      5.11.2+dfsg-1                   
  5. amd64        Python 2 bindings for Qt5
  6. ii  python3-pyqt4                                     4.12.1+dfsg-2                   
  7. amd64        Python3 bindings for Qt4
  8. ii  python3-pyqt5                                     5.11.2+dfsg-1                   
  9. amd64        Python 3 bindings for Qt5
  10. ii  python3-pyqt5.qtmultimedia                        5.11.2+dfsg-1                    a
  11. md64        Python 3 bindings for Qt5's Multimedia module
  12. ii  python3-pyqt5.qtopengl                            5.11.2+dfsg-1                    a
  13. md64        Python 3 bindings for Qt5's OpenGL module
  14. ii  python3-pyqt5.qtsvg                               5.11.2+dfsg-1                    a
  15. md64        Python 3 bindings for Qt5's SVG module
  16. ii  python3-pyqt5.qtwebkit                            5.11.2+dfsg-1                    a
  17. md64        Python 3 bindings for Qt5's WebKit module
我决定把python3-pyqt4给卸掉试试运气。

点击(此处)折叠或打开

  1. apt-get remove python3-pyqt4
  2. #call pyzo again
  3. pyzo
  4. Started our command server
  5. Traceback (most recent call last):
  6.   File "/usr/lib/python3/dist-packages/qtpy/__init__.py", line 148, in <module>
  7.     from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
  8. ModuleNotFoundError: No module named 'PySide'

  9. During handling of the above exception, another exception occurred:

  10. Traceback (most recent call last):
  11.   File "/usr/bin/pyzo", line 11, in <module>
  12.     load_entry_point('pyzo==4.4.3', 'console_scripts', 'pyzo')()
  13.   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
  14.     return get_distribution(dist).load_entry_point(group, name)
  15.   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
  16.     return ep.load()
  17.   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
  18.     return self.resolve()
  19.   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
  20.     module = __import__(self.module_name, fromlist=['__name__'], level=0)
  21.   File "/usr/share/pyzo/pyzo/__init__.py", line 87, in <module>
  22.     from pyzo.util.qt import QtCore, QtGui, QtWidgets
  23.   File "/usr/share/pyzo/pyzo/util/qt/__init__.py", line 13, in <module>
  24.     from qtpy import *
  25.   File "/usr/lib/python3/dist-packages/qtpy/__init__.py", line 154, in <module>
  26.     raise PythonQtError('No Qt bindings could be found')
  27. qtpy.PythonQtError: No Qt bindings could be found
我的运气就这么来了, No module named 'PySide'. 装上Pyside

点击(此处)折叠或打开

  1. root@kali:/usr/local/src/py# apt-cache search pyside
  2. libpyside-dev - Python bindings for Qt 4 (development files)
  3. libpyside-py3-1.2 - Python3 bindings for Qt 4 (base files)
  4. libpyside1.2 - Python bindings for Qt 4 (base files)
  5. libpythonqt-qt5-common-dev - Dynamic Python binding for the Qt framework - development
  6. libpythonqt-qt5-python2-3 - Dynamic Python binding for the Qt framework - runtime
  7. libpythonqt-qt5-python2-dev - Dynamic Python binding for the Qt framework - development
  8. libpythonqt-qt5-python3-3 - Dynamic Python binding for the Qt framework - runtime
  9. libpythonqt-qt5-python3-dev - Dynamic Python binding for the Qt framework - development
  10. libpythonqt-qtall-qt5-common-dev - Dynamic Python binding for the Qt framework - development
  11. libpythonqt-qtall-qt5-python2-3 - Dynamic Python binding for the Qt framework - runtime
  12. #此处删掉了50行 -for brevity

  13. root@kali:/usr/local/src/py# apt-get install python3-pyside
  14. root@kali:/usr/local/src/py# apt-get install python3-pyqt4
然后再运行pyzo.

点击(此处)折叠或打开

  1. root@kali:~# pyzo
  2. Started our command server
  3. Stopped our command server.
  4. root@kali:~#
  5. p, li { white-space: pre-wrap; }

    Pyzo - Python to the people!

    Version info
    Pyzo version: 4.4.3 (source)
    Platform: linux
    Python version: 3.6.6
    Qt version: 4.8.7
    PySide version: 1.2.2

    Pyzo directories
    Pyzo source directory: /usr/share/pyzo/pyzo
    Pyzo userdata directory: /root/.pyzo

    Acknowledgements
    Pyzo is written in Python 3 and uses the Qt widget toolkit. Pyzo uses code and concepts that are inspired by IPython, Pype, and Spyder. Pyzo uses a (modified) subset of the silk icon set, by Mark James ().


EOF




阅读(3135) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~