擅长:python、mysql、java
<p>首先:<strong>不要</strong>删除python-2.7,<strong>不要</strong>以任何方式修改现有的python-2.7安装。在</p>
<p>要将PyQt4与python3一起使用,您需要为python3安装特定于python3的ubuntu包:我认为这是python3-PyQt4</strong>包。所以,首先,试着:</p>
<pre><code>sudo apt-get install python3-pyqt4
</code></pre>
<p>如果可以的话,您应该能够运行<code>python3</code>来启动一个解释器,然后执行<code>from PyQt4 import QtCore</code>来检查是否一切正常。在</p>
<p>一般来说,每个python安装都会有一组特定于python2或python3的库。因此,如果您需要python3的其他库,您必须检查是否有“python3xxx”ubuntu包可供使用。在</p>