Unable to run Python script from specific directoy. What could be the reason?
<p>1) OS = MacOS (El Capitan)</p>

<p>2) Using native Python install</p>

<p>3) Problem:  I wrote a script in a directory called "pythonscripts". This will not run from this directory. If I copy the same script to a directory above this, or one below this or to the user's home directory, it runs just fine. I have attempted all kinds of things including renaming the "pythonscripts" to other names and I have no idea. </p>

<p>Hints appreciated. Below the output of my tests to see for yourselves...</p>

<pre><code>MAC:pythonscripts user1$ cp googlemaps1.py ~
MAC:pythonscripts user1$ cp googlemaps1.py ../
MAC:pythonscripts user1$ cp googlemaps1.py Learning-Python/
MAC:pythonscripts user1$ 
MAC:pythonscripts user1$ cd ../
MAC:coding user1$ python googlemaps1.py 
directions_result: &lt;type 'list'&gt; 1
PERFECT EXECUTION!
MAC:coding user1$ cd pythonscripts/Learning-Python/
MAC:Learning-Python user1$ python googlemaps1.py 
directions_result: &lt;type 'list'&gt; 1
PERFECT EXECUTION!
MAC:Learning-Python user1$ cd ..
MAC:pythonscripts user1$ python googlemaps1.py 
{'and': 3, 'envious': 1, 'already': 1, 'fair': 1, 'is': 3, 'through': 1, 'pale': 1, 'yonder': 1, 'what': 1, 'sun': 2, 'Who': 1, 'But': 1, 'moon': 1, 'window': 1, 'sick': 1, 'east': 1, 'breaks': 1, 'grief': 1, 'with': 1, 'light': 1, 'It': 1, 'Arise': 1, 'kill': 1, 'the': 3, 'soft': 1, 'Juliet': 1}
Traceback (most recent call last):
  File "googlemaps1.py", line 8, in &lt;module&gt;
    from googlemaps import Client
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/__init__.py", line 20, in &lt;module&gt;
    from googlemaps.client import Client
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/client.py", line 30, in &lt;module&gt;
    import requests
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/__init__.py", line 64, in &lt;module&gt;
    from . import utils
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/utils.py", line 24, in &lt;module&gt;
    from .compat import parse_http_list as _parse_list_header
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/compat.py", line 38, in &lt;module&gt;
    from urllib2 import parse_http_list
ImportError: cannot import name parse_http_list
MAC:pythonscripts user1$ cd 
MAC:~ user1$ python googlemaps1.py 
directions_result: &lt;type 'list'&gt; 1
PERFECT EXECUTION!
MAC:~ user1$ 
</code></pre>

<p>This is driving me crazy!  as you can see I can run the same exact script from 3 other locations except for the original directory where I saved the script. 
Any ideas? anyone experienced anything like this before ? 
Thanks,</p>

<p>If you have a file called urllib2.py, you must rename it.
You should never name a script like a python package/module.</p>

python osx