Python find and replace dialog from Rapid GUI Programming error
<p>When building the find and replace dialog from "Rapid GUI Programming with Python and Qt (Chapter 07), by Prentice Hall (Mark Sumerfield)", I get the following error:</p>

<pre><code>    import ui_findandreplacedlg
ImportError: No module named ui_findandreplacedlg
</code></pre>

<p>Depending on which version of python I run, I also get:</p>

<pre><code>File "findandreplacedlg.py", line 7, in &lt;module&gt;  
    ui_findandreplacedlg.Ui_FindAndReplaceDlg):  
AttributeError: 'module' object has no attribute 'Ui_FindAndReplaceDlg'
</code></pre>

<p>I got the source code from their website and it errors on the same line in the same way. I've searched the errata on their webpage with no mention whatsoever. Does anyone know what the solution is? </p>

<p>The code in question can be found here - <a href="https://github.com/suzp1984/pyqt5-book-code/blob/master/chap07/ui_findandreplacedlg.py" rel="nofollow">https://github.com/suzp1984/pyqt5-book-code/blob/master/chap07/ui_findandreplacedlg.py</a>. If that file is in the same directory as the code you're trying to run, just do </p>

<pre><code>import ui_findandreplacedlg
</code></pre>

python qt pyqt importerror