import urllib.parse fails when Python run from command line
问题 I have observed the following behavior in python 3.4.2, and I am unableto explain it. Hopefully someone could shed some light on the matter: In IPython: In [129]: import urllib In [130]: print(urllib.parse) <module 'urllib.parse' from '/Users/ashwin/.pyenv/versions/3.4.2/lib/python3.4/urllib/parse.py'> I've imported a module, and printed one of its attributes. Everything works as expected. So far, life is good. Now, I do the same thing from the command line: $ python -c 'import urllib; print