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>You need to make your common folder into a python package in order to import it in python. I think you've tried to do it and created <code>init</code> file in your <code>common</code> folder but actually it must be <code>__init__.py</code>. Rename it like this and then your package will be visible to python.</p>

<p>Hope it helps!</p>

python python-3.x pycharm