Hello,
I am having an issue with using the azure-common package on my windows 10 system.
Python version:
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
I run my python code from within pipenv to prevent packages from interfering with each other:
(.venv) C:\python\test>python -m pip install --upgrade pip
Looking in indexes: https://pypi.org/simple, https://pypi-read-only:****@enexis.jfrog.io/enexis/api/pypi/pypi/simple
Requirement already up-to-date: pip in c:\python\test\.venv\lib\site-packages (19.0.3)
(.venv) C:\python\test>exit
C:\python\test>python -m pip install --upgrade pip
Looking in indexes: https://pypi.org/simple, https://pypi-read-only:****@enexis.jfrog.io/enexis/api/pypi/pypi/simple
Requirement already up-to-date: pip in c:\applications\python37-32\lib\site-packages (19.0.3)
My Pipfile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
ptpython = "*"
azure-common = "*"
azure-mgmt-resource = "*"
azure-mgmt-network = "*"
azure-nspkg = "*"
[requires]
python_version = "3.7"
Global installed packages:
C:\python\test\azure>pip freeze
certifi==2019.3.9
pipenv==2018.11.26
virtualenv==16.4.3
virtualenv-clone==0.5.1
code being ran:
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt.network import NetworkManagementClient
Error:
Traceback (most recent call last):
File "azure.py", line 37, in <module>
from azure.common.credentials import ServicePrincipalCredentials
File "C:\python\test\azure.py", line 37, in <module>
from azure.common.credentials import ServicePrincipalCredentials
ModuleNotFoundError: No module named 'azure.common'; 'azure' is not a package
Things I have tried:
Anyone got any thoughts on fixing this?
I can comment the azure.common.credentials import line and it will give the exact same modulenotfound error on mgmt.resource, and same again for mgmt.network.
Please rename your personal file from azure.py to something else, as the message says, you file is understood by Python as THE azure name and hide everything else:
No module named 'azure.common'; 'azure' is not a package
I'm confident enough this is your issue to close it, but feel free to still comment if I'm wrong or open new issues if necessary. Thanks!
Most helpful comment
Please rename your personal file from
azure.pyto something else, as the message says, you file is understood by Python as THE azure name and hide everything else: