바뀜

둘러보기로 가기 검색하러 가기
353 바이트 제거됨 ,  2017년 8월 29일 (화) 22:10
편집 요약 없음
'''python configure.py'''를 입력합니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/sip-4.17# chmod 655 configure.py; python configure.py
This is SIP 4.17 for Python 2.7.9 on linux2.
Creating sip code generator Makefile...
Creating sip module Makefile...
</syntaxhighlightpre>
=== make ===
'''make'''를 실행합니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/sip-4.17# make
make[1]: Entering directory '/home/westporch/Downloads/sip-4.17/sipgen'
make: [all] Error 2
root@localhost:/home/westporch/Downloads/sip-4.17#
</syntaxhighlightpre>
만약 위와같은 메시지가 발생하면 ''python-dev''를 설치합니다. ('''apt-get install python-dev''')
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/sip-4.17# apt-get install python-dev
패키지 목록을 읽는 중입니다... 완료
Preparing to unpack .../libpython2.7-dev_2.7.9-2_i386.deb ...
(..이하 생략..)
</syntaxhighlightpre>
python-dev 설치가 끝나면 다시 '''make'''를 실행합니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/sip-4.17# make
make[1]: Entering directory '/home/westporch/Downloads/sip-4.17/sipgen'
make[1]: Leaving directory '/home/westporch/Downloads/sip-4.17/siplib'
root@localhost:/home/westporch/Downloads/sip-4.17#
</syntaxhighlightpre>
=== make install ===
'''make install'''을 실행합니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/sip-4.17# make install
make[1]: Entering directory '/home/westporch/Downloads/sip-4.17/sipgen'
cp -f /home/westporch/Downloads/sip-4.17/sipdistutils.py /usr/lib/python2.7/dist-packages/sipdistutils.py
root@localhost:/home/westporch/Downloads/sip-4.17#
</syntaxhighlightpre>
== PyQt 설치 ==
'''python configure.py'''을 실행하고 ''yes''를 입력합니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4# python configure.py
Determining the layout of your Qt installation...
Checking to see if the QtOpenGL module should be built...
(..이하 생략..)
</syntaxhighlightpre
=== make ===
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4# make
</syntaxhighlightpre>
=== make install ===
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4# make install
</syntaxhighlightpre>
== PyQt 설치 확인 ==
PyQt를 설치할 때 python configure.py, make, make install을 실행한 폴더에서 하위 폴더인 examples/widgets로 이동합니다. 제 경로는 다음과 같습니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets# pwd
/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets
calculator.py digitalclock.py imageviewer.py scribble.py spinboxes.py tetrix.py windowflags.py
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets#
</syntaxhighlightpre>
'''python digitalclock.py'''를 실행했을 때 GUI 화면이 나타나면 PyQt가 제대로 설치된 것입니다.
아래와 같은 메시지가 출력되면서 PyQt의 GUI 화면이 나타나지 않는 경우가 있습니다.
<syntaxhighlight lang=""pre>
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets# python digitalclock.py
No protocol specified
digitalclock.py: cannot connect to X server :0
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets#
</syntaxhighlightpre>
이럴 때는 '''su''' 명령을 사용하기 전에 '''xhost +'''를 먼저 입력해야 합니다. 아래 화면을 참고해주세요.
<syntaxhighlight lang=""pre>
westporch@localhost:~$ xhost +
access control disabled, clients can connect from any host
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets#
root@localhost:/home/westporch/Downloads/PyQt-x11-gpl-4.11.4/examples/widgets# python digitalclock.py
</syntaxhighlightpre>
<img src="https://lh3.googleusercontent.com/-aGZGqIQzsOE/VqIkS9jwmkI/AAAAAAAACUk/i84ytILtUlc/s151-Ic42/PyQt_Digitalclock.png">

둘러보기 메뉴