title: Bad Python package organization installed a `tests` package to my path? (Anaconda)
body: <p>Somehow (due to some bad advice) I believe have been <a href="https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure" rel="nofollow noreferrer">bitten</a> by <a href="https://hynek.me/articles/testing-packaging/" rel="nofollow noreferrer">using</a> a <a href="https://docs.pytest.org/en/latest/goodpractices.html" rel="nofollow noreferrer">shoddy</a> organization of my project directory. </p>
  
  <p>It currently looks like this (GOOD!):</p>
  
  <pre><code>\projectname
     setup.py
     LICENSE
     MANIFEST.in
     README.rst
     CHANGELOG.rst
     \src
        \projectname
           __init__.py
     \tests
        __init__.py
        test1.py
  </code></pre>
  
  <p>However, it used to look like this (BAD!): </p>
  
  <pre><code>\package_name
     setup.py
     LICENSE
     MANIFEST.in
     README.rst
     CHANGELOG.rst
     \projectname &lt;--- main package at top level
        __init__.py
     \tests
        test1.py
  </code></pre>
  
  <p>Prior to fixing my shoddy setup, I was using an editable install of the project (<code>python setup.py develop</code>). I have subsequently removed (<code>pip uninstall my_package</code>) that install (and re-added) several times.  </p>
  
  <p>Despite removing it, I have now discovered that I seem to have a package called <code>tests</code> available for importing! And the package path is pointed to the directory of my project: </p>
  
  <pre><code>&gt;&gt;&gt; import tests
  &gt;&gt;&gt; tests.__path__
  _NamespacePath(['c:\\users\\username\\projects\\projectname\\tests'])
  </code></pre>
  
  <p>I am guessing this happened as a result of installing my package using the initial broken package organization. </p>
  
  <p><strong>How can I remove this <code>tests</code> "package" from my path?</strong> I am using Anaconda 4.3 (latest version). <code>pip uninstall tests</code> was not successful. </p>
  
  <p>NOTE: My project has also been published to pypi (project name: parmatter) and I did install it once from there as a test, but only after using the modified project organization structure, so I don't think this was the cause. If anyone wants to install it and see if it leads to the same problem, that may at least help me nail down the cause. </p>
  
  <p>Project repo:  <a href="https://github.com/Ricyteach/parmatter" rel="nofollow noreferrer">https://github.com/Ricyteach/parmatter</a> </p>
  
  <p>Source distribution: <a href="https://pypi.python.org/packages/be/06/337f43391b4ac32b51cf6cc2fce4cfa40be835d1f3925a69080ef73ad4a1/parmatter-0.0.5.tar.gz#md5=ca2ec59e2deb7c10ec7dd8f3342b1f1a" rel="nofollow noreferrer">parmatter-0.0.5.tar.gz</a> </p>
  
  <hr>
  
  <h2>EDIT</h2>
  
  <p>Result of <code>python -m site</code> below. </p>
  
  <pre><code>C:\&gt;python -m site
  sys.path = [
      'C:\\',
      'C:\\Users\\ricky\\Anaconda3\\python36.zip',
      'C:\\Users\\ricky\\Anaconda3\\DLLs',
      'C:\\Users\\ricky\\Anaconda3\\lib',
      'C:\\Users\\ricky\\Anaconda3',
      'C:\\Users\\ricky\\Anaconda3\\lib\\site-packages',
      'C:\\Users\\ricky\\Anaconda3\\lib\\site-packages\\Sphinx-1.5.6-py3.6.egg',
      'c:\\users\\ricky\\projects\\parmatter',
      'C:\\Users\\ricky\\Anaconda3\\lib\\site-packages\\win32',
      'C:\\Users\\ricky\\Anaconda3\\lib\\site-packages\\win32\\lib',
      'C:\\Users\\ricky\\Anaconda3\\lib\\site-packages\\Pythonwin',
      'C:\\Users\\ricky\\Anaconda3\\lib\\site-packages\\setuptools-27.2.0-py3.6.egg',
  ]
  USER_BASE: 'C:\\Users\\ricky\\AppData\\Roaming\\Python' (doesn't exist)
  USER_SITE: 'C:\\Users\\ricky\\AppData\\Roaming\\Python\\Python36\\site-packages' (doesn't exist)
  ENABLE_USER_SITE: True
  </code></pre>
  
  <p>It appears I need to remove the project directory from <code>site</code>... how do I do that? And how did it get there in the first place? </p>