怎么在linux下搭建pyqt的开发环境 如何在linux系统安装python编程环境

linux\u7cfb\u7edf\u600e\u4e48\u642d\u5efa\u5f00\u53d1\u73af\u5883

developer/sdk/installing/sdk/eclipse-adt/sdk/index.html \u4e0b\u8f7dlinux\u7248\u672c4. \u901a\u8fc7ADT\u63d2\u4ef6\u5173\u8054\u89e3\u538b\u540e\u7684Android SDK\u76ee\u5f555. \u5173\u8054\u4e4b\u540e\uff0c\u6839\u636e\u4f60\u7684\u9700\u8981\uff0c\u4e5f\u662f\u901a\u8fc7ADT\uff0c\u4e0b\u8f7d\u5176\u4ed6platform(2.2, 2.3, 4.0,4.0.3\u7b49)\u3002

\u8be6\u7ec6\u8bf4\u4e0bLinux\u548cMac OS\u600e\u4e48\u642d\u5efaPython\u73af\u5883\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u770b\u5bf9\u5e94\u90e8\u5206\u3002
\u6253\u5f00\u7ec8\u7aef
Linux\u548cMac OS\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u5747\u9700\u8981\u6253\u5f00\u7ec8\u7aef\u8fdb\u884c\u64cd\u4f5c\uff0c\u8fd9\u91cc\u7b80\u8981\u8bf4\u660e\u4e00\u4e0b\u5982\u4f55\u6253\u5f00\u7cfb\u7edf\u7ec8\u7aef\u3002\u7531\u4e8eLinux\u53d1\u884c\u7248\u6709\u592a\u591a\u7248\u672c\uff0c\u6240\u4ee5\u8fd9\u91cc\u53ea\u8bf4\u660e\u56fd\u5185\u540c\u5b66\u4eec\u7528\u7684\u6700\u591a\u7684Ubuntu\u64cd\u4f5c\u7cfb\u7edf\u3002Ubuntu\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u4f7f\u7528\u5feb\u6377\u952e\uff0cCtrl + Alt + t\u6253\u5f00\u7ec8\u7aef\uff0cUbuntu\u7684\u7ec8\u7aef\u6253\u5f00\u4e4b\u540e\u5927\u6982\u662f\u8fd9\u6837\uff1a

\u63a5\u4e0b\u6765\u5c31\u662f\u5728Mac OS\u4e2d\u6253\u5f00\u7ec8\u7aef\u4e86\uff0cMac OS\u53ef\u4ee5\u901a\u8fc7\u5728\u805a\u7126\u641c\u7d22\u4e2d\u641c\u7d22Terminal\u7684\u65b9\u5f0f\u6765\u6253\u5f00\u7ec8\u7aef\uff0c\u805a\u7126\u641c\u7d22\u7684\u5feb\u6377\u952e\u662fCommand +\u7a7a\u683c\u952e\u3002
Linux \u7bc7
\u786e\u8ba4\u7248\u672c
\u7531\u4e8e\u7edd\u5927\u90e8\u5206Linux\u64cd\u4f5c\u7cfb\u7edf\u90fd\u81ea\u5e26\u4e86Python\uff0c\u6240\u4ee5\u8981\u5148\u786e\u5b9a\u4f60\u7684Linux\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u5b89\u88c5\u7684Python\u7248\u672c\uff1a
$ python --version
Python 2.7.15
\u4e00\u822c\u6765\u8bb2\uff0c\u81ea\u5e26\u7684\u9ed8\u8ba4Python\u7248\u672c\u90fd\u662fPython2.x\uff0c\u90e8\u5206\u7cfb\u7edf\u8fd8\u5b89\u88c5\u4e86\u4e00\u4e2aPython3\u7248\u672c\uff0c\u8bf7\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u786e\u5b9a\u662f\u5426\u5b89\u88c5\u4e86Python3\u4ee5\u53ca\u5b83\u7684\u7248\u672c\uff1a
$ python3 --version
\u5982\u679c\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b(\u8fd1\u4f3c\u5730)\uff0c\u5219\u8bf4\u660e\u4f60\u7684\u7cfb\u7edf\u5df2\u7ecf\u5b89\u88c5\u4e86Python3\u7684\u67d0\u4e2a\u7248\u672c\uff1a
$ python3 --version
Python 3.7.3
\u5982\u679c\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b(\u8fd1\u4f3c\u5730)\uff0c\u5219\u8bf4\u660e\u4f60\u7684\u7cfb\u7edf\u5c1a\u672a\u5b89\u88c5Python3\u7684\u67d0\u4e2a\u7248\u672c\uff1a
$ python3 --version
bash: command not found: python3
\u5b89\u88c5
Debian\u53ca\u5176\u884d\u751f\u7248\u672c\uff0c\u6bd4\u5982\u7684Ubuntu\uff0c\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\uff1a
$ sudo apt-get install python3
Red Hat\u53ca\u5176\u884d\u751f\u7248\u672c\uff0c\u6bd4\u5982CentOS\uff0c\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\uff1a
$ sudo yum install python3
\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u6210\u529f
\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u6210\u529f\u548c\u786e\u8ba4\u7248\u672c\u7684\u6b65\u9aa4\u4e00\u81f4\uff0c\u5982\u679c\u53ef\u4ee5\u6b63\u786e\u663e\u793a\u7248\u672c\uff0c\u5c31\u662f\u5b89\u88c5\u6210\u529f\u4e86\u3002
Mac OS\u7bc7
\u786e\u8ba4\u7248\u672c
\u548cLinux\u7cfb\u7edf\u7c7b\u4f3c\uff0cMac\u7cfb\u7edf\u5728\u5b89\u88c5\u4e4b\u524d\u8981\u786e\u5b9a\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86\u76f8\u5e94\u7684\u7248\u672c\uff0cPython\u9ed8\u8ba4\u7248\u672c\uff0c\u4e00\u822c\u5747\u4e3aPython2\uff1a
$ python --version
Python 2.7.15
\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u4e86Python3
$ python3 --version
Python 3.7.3
\u4e00\u822c\u60c5\u51b5\u4e0bMac OS\u5747\u672a\u5b89\u88c5Python3.x\u3002
\u5b89\u88c5
Mac OS\u65e2\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5b89\u88c5\uff0c\u4e5f\u53ef\u4ee5\u50cfWindows\u7cfb\u7edf\u4e00\u6837\u4e0b\u8f7d\u5b89\u88c5\u5305\u5e76\u5b89\u88c5\u3002\u8fd9\u91cc\u4ec5\u8ba8\u8bba\u5bf9\u65b0\u624b\u6bd4\u8f83\u53cb\u597d\u7684\u4e0b\u8f7d\u5b89\u88c5\u5305\u5b89\u88c5\u7684\u65b9\u5f0f\u3002\u5728Python\u5b98\u7f51\u4e2d\u627e\u5230Downloads\uff0c\u5e76\u9009\u62e9Mac OS X\uff0c

\u7136\u540e\u8fdb\u5165\u9875\u9762\uff0c32\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u7684\u540c\u5b66(\u8fd9\u79cd\u540c\u5b66\u5e94\u8be5\u5f88\u5c11)\u9009\u62e9"macOS 64-bit/32-bit installer"\uff0c\u5426\u5219\u9009\u62e9"macOS 64-bit installer"\uff0c\u7136\u540e\u9009\u62e9\u4f60\u9700\u8981\u7684Python\u7248\u672c\uff0c\u6bd4\u5982Python3.7.3\u3002

\u4e0b\u8f7d\u5b8c\u6210\u4e4b\u540e\uff0c\u70b9\u5f00\u538b\u7f29\u5305\uff0c\u4e00\u76f4\u201c\u4e0b\u4e00\u6b65\u201d\u5c31\u53ef\u4ee5\u5b89\u88c5\u6210\u529f\u4e86\u3002

\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u6210\u529f
\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u6210\u529f\u548c\u786e\u8ba4\u7248\u672c\u7684\u6b65\u9aa4\u4e00\u81f4\uff0c\u5982\u679c\u53ef\u4ee5\u6b63\u786e\u663e\u793a\u7248\u672c\uff0c\u5c31\u662f\u5b89\u88c5\u6210\u529f\u4e86\u3002
\u5e0c\u671b\u6211\u7684\u56de\u7b54\u80fd\u5e2e\u5230\u4f60\uff01

以Ubuntu 12.10下搭建PyQt环境为例!
make
安装Python(由于此版本默认有Python2.7和Python3.2故可省去)
第一步:下载Qt4源代码
第二步:下载SIP( SIP is a tool forautomatically generating Python bindings for C andC++ libraries)
第三步:下载PyQt
第四步:配置SIP:
解压sip-XXXXX.tar.gz压缩包,进入sip-XXXXX目录
运行
python configure.py
注意:If you have multiple versions of Python installed then make sure
you use theinterpreter for which you wish SIP to generate bindings for.
也就是说我采用Python3.x进行开发,那么使用的命令是:python3 configure.py
shell下的结果是:
lieo@ubuntu:~/download/sip-4.14.2$ python3 configure.py
This is SIP 4.14.2 for Python 3.2.3 on linux2.
The SIP code generator will be installed in /usr/bin.
The sip module will be installed in /usr/lib/python3/dist-packages.
The sip.h header file will be installed in /usr/include/python3.2mu.
The default directory to install .sip files in is /usr/share/sip.
make
注意: 这步可能会报找不到Python.h文件的错误(没报错跳到make install)
这是因为缺失头文件和静态库包,
假如使用python2.7运行
sudo apt-get install python-dev
假如使用python3运行
sudo apt-get install python3-dev
make install
第五步:编译安装Qt4
Ubuntu默认没有编译环境,运行以下命令安装编译环境
sudo apt-get install build-essential
#进入qt源码目录运行
./configure
结果:Qt will be installed into /usr/local/Trolltech/Qt-4.8.4
make
make install
1.如果在./configure阶段,出现了以下错误
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11
那是因为没装有libxtst-dev,使用命令apt-get install libxtst-dev安装
2.如果在make阶段,出现一下错误
/usr/bin/ld: cannot find -lXrender
make[1]: *** [../../../../lib/libQtWebKit.so.4.7.3] 错误 1
make: *** [sub-webkit-make_default-ordered] 错误 2
那是因为没有装libxrender-dev
3.在qt create中,尝试编译测试,如果找不到qmake,则在工具-选项-QT4中手动设置qmake的位置。qmake的位置默认在/usr/local/Trolltech/Qt-4.8.4/bin/qmake。
当这几个步骤全部完成后,把“PATH=/usr/local/Trolltech/Qt-4.8.4/bin:$PATH
export PATH”加到.profile中,Qt就安装成功了。
或者 在.bashrc文件(如果你的shell是bash、ksh、zsh或者sh)中,添加下面这些行:
QTDIR=/usr/local/Trolltech/Qt-4.8.4
PATH=$QTDIR/bin:$PATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
第六步:安装PyQt
#进入PyQt源码目录运行以下命令安装PyQt
#前提是Qt4和SIP以正确安装
python configure.py
make
make install
至此配置完成

嵌入式Linux的ftp最常用来完成开发板和开发环境Linux系统之间的的文件传输功能,避免了频繁的U盘拷贝的过程。



根据安装手册安装就行啊
看看wo的网名?

  • linux绯荤粺濡備綍瀹夎pythonlinux瀹夎python鐜
    绛旓細1銆佷笅杞芥簮浠g爜 2銆佸畨瑁 tar_jxvfPython-2.5.2.tar.bz2 cdPython-2.5.2 ./configure make makeinstall 3銆佹祴璇 鍦ㄥ懡浠よ涓嬭緭鍏ython锛屽嚭鐜皃ython瑙i噴鍣ㄥ嵆琛ㄧず宸茬粡姝g‘瀹夎銆傚湪suse10鎴杛hel5锛坋s5锛変笅绯荤粺榛樿宸茬粡瑁呬簡python浣嗙増鏈槸2.4.x锛涙湰娆″畨瑁呭悗鍦╯hell涓緭鍏 python 浼氬彂鐜版樉绀虹粨鏋滐細python...
  • 鎬庝箞鍦╨inux涓嬫惌寤簆yqt鐨勫紑鍙戠幆澧
    绛旓細绗竴姝ワ細涓嬭浇Qt4婧愪唬鐮 绗簩姝ワ細涓嬭浇SIP( SIP is a tool forautomatically generating Python bindings for C andC++ libraries)绗笁姝ワ細涓嬭浇PyQt 绗洓姝ワ細閰嶇疆SIP:瑙e帇sip-XXXXX.tar.gz鍘嬬缉鍖,杩涘叆sip-XXXXX鐩綍 杩愯 python configure.py 娉ㄦ剰锛欼f you have multiple versions of Python installed t...
  • 璋佷細鍦╨inux涓缂栬瘧瀹夎pyqt4
    绛旓細绗竴绉嶏細 浣犲凡瀹夎setuptools 鐒跺悗easy_install pyqt4 绗簩绉嶏細涓嬭浇pyqt4 鐒跺悗瑙e帇锛岃繘鍏yqt4鐨勭洰褰 python setup.py install
  • 鍦↙inux centos7.0涓嬪畨瑁呭拰pyqt4鍜孍ric
    绛旓細1銆佷娇鐢▂um瀹夎锛岄鍏堥渶瑕佹坊鍔爀pel婧愶紝鐒跺悗 yum list qscintilla*搴旇鍙互鐪嬪埌鍙敤鐨剄scintilla鐨勫畨瑁呭寘锛屼娇鐢▂um鍛戒护瀹夎鍗冲彲锛屼絾鏄湁鍙兘瀹夎鐨勭増鏈笉涓瀹氭槸2.8.4浜 yum install qscintilla 2銆佹簮鐮佺紪璇戞柟娉 a.棣栧厛涓嬭浇婧愮爜鍖匭Scintilla-gpl-2.8.4.tar.gz b.瑙e帇婧愮爜鍖咃細tar -zxvf QScintilla-gpl...
  • Python鍥惧舰鐣岄潰搴Pyqt5
    绛旓細璁╂垜浠氳繃瀹炰緥閫愭浜嗚В濡備綍浣跨敤PyQt5鏋勫缓涓涓熀纭鐨勮绠楀櫒锛岄鍏堝垱寤轰竴涓獥鍙o紝鍖呭惈鏂囨湰杈撳叆妗嗗拰鍩烘湰杩愮畻鎸夐挳:```html 绐楀彛鏋勫缓 鏁板瓧1: 鏁板瓧2: 杩愮畻鎸夐挳 + - * / 缁撴灉鏄剧ず: 缁撴灉锛歚``鍏抽敭鐨勪唬鐮侀儴鍒嗭紝鎴戜滑鍒涘缓浜嗗嚱鏁版潵鍝嶅簲鎸夐挳鐐瑰嚮锛屽`add_f`澶勭悊鍔犳硶:```html```绐楀彛鐨勬樉绀...
  • ubuntu16.04鎬庝箞鎼缓python寮鍙戠幆澧
    绛旓細鍘熸潵鍦╳indows涓嬪疄鐜扮殑python code,鍥犱负涓氬姟闇瑕,瑕佸皢鍏舵斁鍒癠buntu(鍏跺疄鏄Linux)涓嬫潵杩涜寮鍙戝拰demo銆傚洜姝ゅ畨瑁呬簡鐩墠鏈鏂扮殑Ubuntu16.04 64bit绯荤粺,骞鎼缓甯︽湁GUI鐨刾ython寮鍙戠幆澧冦傜幆澧冧笌宸ュ叿閫夋嫨鏈缁堢‘璁ら夋嫨鈥淯buntu16.04(64 bit)+ Python3.5 + Qt5.7.0 + SIP4.18.1 + PyQt5.7 + QScintilla2.9.2 + Eric6.0 鈥...
  • linux涓巕t
    绛旓細棣栧厛锛屾仌鎴戠洿瑷锛岃繖涔堥棶锛岃鏄庝綘瀹屽叏娌℃悶娓呮Python鍜孮t鏄粈涔堬紝Linux涓鍥惧舰寮鍙戯紝Qt姣棤鐤戦棶鏄富娴侊紝linux閲岄潪甯告祦琛岀殑绐楀彛绠$悊绯荤粺KDE灏辨槸鍩轰簬Qt锛岃繕鏈塙buntu瀹e竷涓嬩竴涓増鏈篃灏嗗熀浜嶲t锛孭ython褰撶劧涔熷簲璇ュ锛岃屼笖Python閲屼富娴佺殑寮鍙戠晫闈㈢殑妗嗘灦PyQt灏辨槸缁戝畾Qt鐨勫簱锛屼綘鎶婅繖涓や釜瀵规瘮锛屽畬鍏ㄦ槸娌℃悶娓呮Python鍜...
  • linux涓婸yQt5瀹夎澶辫触,姹傚姪
    绛旓細sudo root; //鍒囨崲鍒皉oot瓒呯骇绠$悊鍛樻ā寮忋俢hmod +x 鏂囦欢缁濆鍦板潃/鏂囦欢鍚.sh //缁欒繖涓枃浠舵巿浜堟墽琛屾潈闄愩./鏂囦欢鍚.sh //杩愯姝ゆ枃浠躲
  • Linux鍒濆鑰呮眰鍔,No module named PyQt5.QtCore
    绛旓細鎴戠殑python2.6+PyQt-Py2.6-gpl-4.8.1-1.exe灏辨病闂銆傘傘傜湅鏈夋病鏈夊鍏ョ殑璇濇槸鐪媍lasspath鑰屼笉鏄痯ath 浣犳妸E:\PYQt\python2.7.1\Lib\site-packages鎴栬呯洿鎺:\PYQt\python2.7.1\Lib娣诲姞鍒癱lasspath璇曡瘯鍛
  • 濡備綍缂栧啓linux鑱婂ぉ瀹
    绛旓細鑰屽懡浠よ涓嬬殑瀹㈡埛绔(涓婇潰鐨 client.cpp 鏂囦欢)鐨勮繍琛岀晫闈㈡槸杩欐牱瀛愮殑: 鏈嶅姟绔殑杩愯鎯呭喌鏄: PyQt4 缂栧啓鐨勫鎴风(pyqt_client.py)浠g爜鏄: #!/usr/bin/env python#-*- coding: utf-8 -*-from PyQt4 import QtGui, QtCoreimport sysimport socketimport threadclass Client(QtGui.QWidget):BUF_LEN = 1024...
  • 扩展阅读:免费翻外国墙软件 ... 个人服务器搭建linux ... 每天试用一小时vp加速器 ... linux搭建哪些服务器 ... 如何搭建自己的网站 ... linux搭建http代理服务器 ... 小飞机服务器节点购买 ... 免费linux服务器软件 ... 三叶草vqn加速软件 ...

    本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网