Cannot import logging.py after I renamed one of my source files logging.py in my Eclipse project
<p>I thought, I broke Eclipse by renaming one of my source file logging.py, I quickly changed the name to something else but Eclipse cannot find the original python standard file ... I reinstalled my Anaconda install but it did not correct the problem ... and I later discovered it was likely a Python problem (see Edit 1)</p>

<p>When I ask Eclipse to find or open the file from the 'import logging' line, it seems it cannot find it ...</p>

<p>Any idea to correct this problem without reinstalling Eclipse?</p>

<pre><code>Traceback (most recent call last):
  File "C:\Users\ailete\workspace\landema\main.py", line 56, in &lt;module&gt;
    import requests
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\__init__.py", line 53, in &lt;module&gt;
    from .packages.urllib3.contrib import pyopenssl
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\packages\__init__.py", line 27, in &lt;module&gt;
    from . import urllib3
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\packages\urllib3\__init__.py", line 8, in &lt;module&gt;
    from .connectionpool import (
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\packages\urllib3\connectionpool.py", line 35, in &lt;module&gt;
    from .connection import (
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\packages\urllib3\connection.py", line 43, in &lt;module&gt;
    from .util.ssl_ import (
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\packages\urllib3\util\__init__.py", line 19, in &lt;module&gt;
    from .retry import Retry
  File "C:\Users\ailete\Anaconda2\Lib\site-packages\requests\packages\urllib3\util\retry.py", line 15, in &lt;module&gt;
    log = logging.getLogger(__name__)
AttributeError: 'module' object has no attribute 'getLogger'
</code></pre>

<p><strong>Edit 1</strong></p>

<p>The problem happens with the executable generated by pyinstaller too ?! :</p>

<pre><code>...
LOADER: Running main.py
Traceback (most recent call last):
  File "&lt;string&gt;", line 43, in &lt;module&gt;
  File "c:\users\ailete\appdata\local\temp\pip-build-iulqaq\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 363, in load_module
  File "C:\Users\ailete\workspace\landema\entities.py", line 7, in &lt;module&gt;
    from config import locale, ribbon_menu
  File "c:\users\ailete\appdata\local\temp\pip-build-iulqaq\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 363, in load_module
  File "C:\Users\ailete\workspace\landema\config.py", line 7, in &lt;module&gt;
    import logging
ImportError: No module named logging
main returned -1
...
</code></pre>

<p>Sorry, I solved it myself.
I thought Eclipse delete the .pyc files when I told it to clean the project, but it is not how it works apparently, So after 2 reinstalls of anaconda and configuration tweaks for this project (I have others ...), I finally remembered to check that ... the .pyc for the file was still there with the old name 'logging.pyc' ... thanks Eclipse as always, for wasting my time with your quirks!</p>

python eclipse rename pyinstaller pyc