우분투 저장소의 공식 Pyqt5 설치가 QtQuick에 대한 지원이 부족한 것 같아서 소스에서 pyqt5를 설치하려고했습니다. 설치 자체가 제대로 작동하는 것 같지만 PyQt5를 사용하는 Python 스크립트를 실행하면 Python은 PyQt를 찾을 수 없다는 불평을합니다.Python이 사용자 정의 PyQt5를 찾지 못했습니다
sip 4.15.5를 빌드 한 후 PyQt5.2를 다운로드했습니다. 그것은 Qt를 내 버전 (qmake --version
의 출력)에 호환되어야합니다 :
QMake version 3.0
Using Qt version 5.2.0 in /opt/qt5.1.1/5.2.0/gcc_64/lib
나는
실행 PyQt는의 configure.py의 출력은 여기에서 찾을 수 있습니다 : https://gist.github.com/Mitmischer/8677889.
pyqt의 설치 출력은 https://gist.github.com/Mitmischer/8677780입니다.
sudo make install
다음에 나는 /usr/lib/python3.3/site-packages
에있는 PyQt5
폴더를 볼 수 있습니다.
# Copyright (c) 2014 Riverbank Computing Limited <[email protected]>
#
# This file is part of PyQt5.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearing in
# the file LICENSE included in the packaging of this file. Please review the
# following information to ensure the GNU General Public License version 3.0
# requirements will be met: http://www.gnu.org/copyleft/gpl.html.
#
# If you do not wish to use this file under the terms of the GPL version 3.0
# then you may purchase a commercial license. For more information contact
# [email protected]
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
네 즉 그 파일 안에 어떤 다야 : 나는 고양이 PyQt5/__init__.py
를 실행하는 경우, 내부에는 실제 코드는 없다. 그런 식으로해야할지 모르겠지만 이상하게 보입니다. 또한 (ls PyQt5
) :
__init__.py QtCore.so QtGui.so QtMultimediaWidgets.so QtPositioning.so QtQuick.so Qt.so QtTest.so QtX11Extras.so
_QOpenGLFunctions_2_0.so QtDBus.so QtHelp.so QtNetwork.so QtPrintSupport.so QtSensors.so QtSql.so QtWebKit.so QtXmlPatterns.so
QtBluetooth.so QtDesigner.so QtMultimedia.so QtOpenGL.so QtQml.so QtSerialPort.so QtSvg.so QtWidgets.so uic/
파이썬으로 보지 않습니다. 다른 제안으로
, 나는 (희망) 적절 내 PYTHONPATH를 설정합니다
> echo $PYTHONPATH
/usr/lib/python3.3/site-packages/
을 지금, 나는 대화 형 python3.3
-session (또는 스크립트)를 시작하는 경우, PyQt5 찾을 수 없습니다 :
Python 3.3.2+ (default, Oct 9 2013, 14:50:09)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'PyQt5'
>>>
다른 사람이 소스에서 PyQt5를 설치하려고 했습니까? PyQt가 작동하도록하려면 어떻게해야합니까?
설치가 성공적으로 보인다. '__init __. py'는 비어 있어야합니다 :'PyQt5'는 단지 네임 스페이스입니다. '* .so' 파일은 모두 컴파일 된 확장 모듈입니다. 내가 생각할 수있는 유일한 점은, 어떻게 든 "잘못된"python3.3을 실행하고 있다는 것입니다. 하나 이상의 설치가 있습니까? – ekhumoro
@ekhumoro : 나는 그렇지 않다.'which -a python3.3'은'/ usr/bin/python3.3'을 보여줍니다. –
호기심. 실험으로 새로운 대화식 세션을 연 다음'os.chdir ('/ usr/lib/python3.3/site-packages')'를 실행하고 PyQt5를 가져와보십시오. – ekhumoro