Import Error: No Module named common
<p>My folder structure in pycharm is as follows.</p>

<pre><code>--python
  --concepts
    --common
      --myds.py
      --__init__.py
    --data_structures
      --test_ds.py
</code></pre>

<p>I have the following line in <code>test_ds.py</code></p>

<pre><code>from common import my_ds
</code></pre>

<p>I get the following error.</p>

<pre><code>ImportError: No module named 'common'
</code></pre>

<p>I have added <code>common</code> to <code>Settings --&gt; Project Interpreter -&gt; Interpreter Paths</code>
and the folder shows up as <code>library root</code>.</p>

<p>Still why am I getting this error.</p>

<p>Try <code>from ..common import my_ds</code>. Also make sure that it has an <code>__init__.py</code> file in that directory (not required but it's good practice).</p>

<p>As for the <code>..</code> they indicate that you're importing from the parent package to the one you're currently on.</p>

python python-3.x pycharm