This project has moved. For the latest updates, please go here.

Import module from python shell works, from a python script doesn't

Oct 22, 2014 at 12:31 AM
Hi, i'm not sure why this is happening:

λ C:\Python27\python.exe Documents\azure\
Traceback (most recent call last):
File "Documents\azure\", line 2, in <module>
import azure                                                                                    
File "C:\Users\Alessio\Documents\azure\", line 3, in <module>
import azure.servicemanagement                                                                  
ImportError: No module named servicemanagement

λ python
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import azure
import azure.servicemanagement
I'm missing to configure some env variable?
Oct 22, 2014 at 12:42 AM
Because your script is called, it itself becomes a module named "azure", shadowing the actual azure package that you're trying to import. You should give it some other name, e.g.
Oct 22, 2014 at 8:38 AM
I've realized after posting the thread :(
Thank you for pointing that out, much appreciated!
Nov 28, 2014 at 5:26 PM