Why running a same script in different location cause errors?
Question: I try to run a script that's using third party module (completely install by
`pip install module`) in Ubuntu 13.10. This script located in NTFS partition.

    
    
    import foo
    
    API_KEY = "xxx"
    api = foo.FOO(APIKEY)
    

and it's return error like

    
    
    $ python test.py
    Traceback (most recent call last):
      File "test.py", line 3, in <module>
        import foo
      File "/media/path/to/project/test.py", line 6, in <module>
        api = foo.Foo(API_KEY)
    AttributeError: 'module' object has no attribute 'Foo'
    

but when I copy a same code to `~/Desktop/test.py` then it's work correctly.
Is script's location cause these error or if it's not what's the problem?


Answer: Check whether there is `foo.py` file in the directory. If there's one, it
could prevent importing the module you want.

Issuing following command in both directory will give you the path of foo
module:

    
    
    python -c "import foo; print(foo.__file__)"
    

If you find there's unexpected `foo.py`, rename it or remove it. (Make sure
there's no `foo.pyc` remain)

