Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'azure.communication' in Mac M2 #6333

Closed
victor-gm opened this issue May 27, 2023 · 8 comments
Closed
Assignees
Labels
Communication Label for AzureCommunicationServices customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@victor-gm
Copy link

victor-gm commented May 27, 2023

Related command

az communication email send --sender "[filled]" --subject "Contoso Update" --to "[filled]" --text "Hello valued client. There is an update."

Extension name (the extension in question)

communication

Description of issue (in as much detail as possible)

Tried to send an email following https://learn.microsoft.com/es-es/cli/azure/communication/email?view=azure-cli-latest and get:

Error

The command failed with an unexpected error. Here is the traceback:
No module named 'azure.communication'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
  File "/Users/***/.azure/cliextensions/communication/azext_communication/manual/_client_factory.py", line 85, in cf_communication_email
    from azure.communication.email import EmailClient
ModuleNotFoundError: No module named 'azure.communication'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Azure CLi Version

azure-cli                         2.49.0

core                              2.49.0
telemetry                          1.0.8

Extensions:
communication                      1.5.2

Dependencies:
msal                              1.20.0
azure-mgmt-resource               22.0.0

Python location '/opt/homebrew/Cellar/azure-cli/2.49.0/libexec/bin/python'
Extensions directory '/Users/***/.azure/cliextensions'

Python (Darwin) 3.10.11 (main, Apr  7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)]

To Reproduce

Run

az communication email send --sender "[filled]" --subject "Contoso Update" --to "[filled]"  --text "Hello valued client. There is an update."

Environment Summary

HOMEBREW_VERSION: 4.0.19-24-ge96fd24
ORIGIN: https://github.com/Homebrew/brew
HEAD: e96fd24a7328a4913de2f7c56fd2c97d9aaa4572
Last commit: 2 days ago
Core tap JSON: 26 May 20:32 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: dodeca-core 64-bit arm_blizzard_avalanche
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.87.0 => /usr/bin/curl
macOS: 13.3.1-arm64
CLT: 14.3.0.0.1.1679647830
Xcode: 14.3
Rosetta 2: false

Tried solutions

pip3 install azure-communication-email
@ghost ghost added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels May 27, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented May 27, 2023

Thank you for opening this issue, we will look into it.

@yonzhan yonzhan added Communication Label for AzureCommunicationServices CXP Attention This issue is handled by CXP team. labels May 27, 2023
@ghost
Copy link

ghost commented May 27, 2023

Thank you for your feedback. This has been routed to the support team for assistance.

@navba-MSFT navba-MSFT self-assigned this May 30, 2023
@navba-MSFT
Copy link
Contributor

@victor-gm Apologies for the late reply. Thanks for reaching out to us and reporting this issue.

Please run the below command in order:

pip3 uninstall azure-communication-email

pip3 install azure-communication-email==1.0.0

pip3 install azure-communication-administration

Please let me know if you still see the same issue after following the above plan.

@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label May 31, 2023
@navba-MSFT
Copy link
Contributor

@victor-gm I wanted to do quick follow-up to check if you had a chance to look at my above comment. Please let us know if you had any updates on this. Awaiting your reply.

@navba-MSFT
Copy link
Contributor

@victor-gm The action is pending on you to try the above suggestions. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.

@BenedekKoncz
Copy link

BenedekKoncz commented Jul 10, 2023

@yonzhan was this ever solved? Same issue here with these versions.

az --version
azure-cli 2.50.0

core 2.50.0
telemetry 1.0.8

Extensions:
aks-preview 0.5.146
communication 1.7.0b1
resource-mover 0.1.1
ssh 2.0.0

Dependencies:
msal 1.22.0
azure-mgmt-resource 23.1.0b2

@sarathkrishnan-007
Copy link

The same fails in MacOS (Intel) as well.
The command failed with an unexpected error. Here is the traceback:
No module named 'azure.communication'

When I installed the extension, it installed without complaining, but doesn't recognise the module
azure-cli 2.57.0

core 2.57.0
telemetry 1.1.0

Extensions:
account 0.2.2
azure-devops 0.18.0
communication 1.8.0b1
costmanagement 0.2.1
reservation 0.3.0
storage-blob-preview 0.7.2
storage-preview 1.0.0b1

Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2

@ethanbayliss
Copy link

Still an issue for me

$ az communication email send --sender $sender \
>                             --subject test \
>                             --cc [email protected] \
>                             --text "body" \
>                             --to $recipient
The command failed with an unexpected error. Here is the traceback:
No module named 'azure.communication'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ethan.bayliss/.azure/cliextensions/communication/azext_communication/manual/_client_factory.py", line 85, in cf_communication_email
    from azure.communication.email import EmailClient
ModuleNotFoundError: No module named 'azure.communication'
pip3 list
Package      Version
------------ --------
certifi      2024.2.2
cffi         1.16.0
cryptography 42.0.7
pip          24.0
pycparser    2.22
wheel        0.43.0
az --version
azure-cli                         2.60.0

core                              2.60.0
telemetry                          1.1.0

Extensions:
communication                      1.9.2
resource-graph                     2.1.0

Dependencies:
msal                              1.28.0
azure-mgmt-resource             23.1.0b2

Python location '/usr/local/Cellar/azure-cli/2.60.0/libexec/bin/python'
Extensions directory '/Users/ethan.bayliss/.azure/cliextensions'

Python (Darwin) 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal
brew list
==> Formulae
aom				gnutls				librsvg				[email protected]
argocd				[email protected]				libslirp			openssl@3
auth0				gradle				libssh				p11-kit
autoconf			graphite2			libtasn1			packer
aws-iam-authenticator		graphviz			libtiff				pango
azure-cli			grep				libtool				parallel
azure-functions-core-tools@3	gts				libunistring			pcre2
bash				harfbuzz			libusb				pinentry
bash-completion@2		helm				libuv				pipenv
brotli				highway				libvmaf				pixman
c-ares				httpie				libx11				pkg-config
ca-certificates			icu4c				libxau				pycparser
cairo				imath				libxcb				pyenv
capstone			iproute2mac			libxdmcp			python-certifi
certifi				isl				libxext				python-cryptography
cffi				jasper				libxrender			[email protected]
colima				jless				lima				[email protected]
cryptography			jpeg-turbo			little-cms2			qemu
devcontainer			jpeg-xl				lz4				readline
docker-credential-helper-ecr	jq				lzo				redis
docutils			keyring				m4				snappy
dtc				krb5				md5sha1sum			sqlite
eksctl				kube-capacity			mongosh				step
fontconfig			kubeaudit			mpdecimal			telnet
freetype			kubelogin			mpfr				tfenv
fribidi				kubernetes-cli			ncurses				unbound
gcc				kustomize			netpbm				vde
gd				libassuan			nettle				watch
gdk-pixbuf			libavif				node				webp
gettext				libevent			node@16				wget
gh				libgcrypt			npth				xorgproto
giflib				libgpg-error			nvm				xz
git				libidn2				oniguruma			yarn
git-crypt			libksba				openexr				ykman
glib				libmpc				openjdk				yq
gmp				libnghttp2			openjdk@11			zstd
gnu-sed				libpng				openjdk@17
gnupg				libpq				openldap

==> Casks
1password-cli			dbeaver-community		microsoft-remote-desktop	powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Communication Label for AzureCommunicationServices customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

6 participants