PyDev: Can't compile after accidentally naming file after Python io.py
Question: So I without thinking stupidly named a file io.py in my working directory.
When I tried to compile I got a traceback error. Having realised what I'd done
I renamed my file and updated references to it but I still get the following
error:

    
    
    Traceback (most recent call last):
      File "C:\Users\Tom\workspace\Converter\get_file.py", line 9, in <module>
        from scipy import complex_
      File "C:\Python27\lib\site-packages\scipy\__init__.py", line 70, in <module>
        from numpy import show_config as show_numpy_config
      File "C:\Python27\lib\site-packages\numpy\__init__.py", line 185, in <module>
        from . import add_newdocs
      File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
        from numpy.lib import add_newdoc
      File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
        from .type_check import *
      File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
        import numpy.core.numeric as _nx
      File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 46, in <module>
        from numpy.testing import Tester
      File "C:\Python27\lib\site-packages\numpy\testing\__init__.py", line 13, in <module>
        from .utils import *
      File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 15, in <module>
        from tempfile import mkdtemp
      File "C:\Python27\lib\tempfile.py", line 32, in <module>
        import io as _io
      File "C:\Users\Tom\workspace\Converter\io.py", line 1, in <module>
        """The io module provides the Python interfaces to stream handling. The
      File "C:\Users\Tom\workspace\Converter\get_file.py", line 9, in <module>
        from scipy import complex_
    ImportError: cannot import name complex_
    

I have restarted PyDev to no avail. I have refreshed the interpreter to no
avail.

I have followed the instructions found in [this Python
issue](http://bugs.python.org/issue22967) but that command returns the correct
result on my machine.

Is tempfile.py a temporary file I can remove to resolve this issue?


Answer: I have found the solution. Stupidly simple but maybe worth leaving here for
other newbies who fall into the same trap.

PyDev compiles the code into *.pyc files. When you update the references and
rename the files these aren't immediately recompiled. Deleting the io.pyc file
I had allowed compilation too run properly.

I found some [more info on common pitfalls](http://python-
notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html) too.

