How do I import a module from within a Pycharm project?
<p>In my project, the file structure is as follows:</p>

<p>root/folder1/folder2/script1.py</p>

<p>root/folder1/folder2/script2.py</p>

<p>I have a statement in script2.py that says "import script1", and Pycharm says no module is found. How do I fix this?</p>

<p>To import as object : </p>

<p><code>from root.folder1.folder2 import script1</code></p>

<p>To import a function of your script:</p>

<p><code>from root.folder1.folder2.script1 import NameOfTheFunction</code></p>

python pycharm