question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module named '_cffi_backend'

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az storage container create

Errors:

No module named '_cffi_backend'
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 528, in execute
    self.commands_loader.load_arguments(command)
azure/cli/core/__init__.py, ln 299, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
cli/core/commands/__init__.py, ln 291, in load_arguments
    super(AzCliCommand, self).load_arguments()
...
storage/v2018_11_09/blob/_encryption.py, ln 13, in <module>
    from cryptography.hazmat.primitives.padding import PKCS7
cryptography/hazmat/primitives/padding.py, ln 13, in <module>
    from cryptography.hazmat.bindings._padding import lib
ModuleNotFoundError: No module named '_cffi_backend'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az storage container create --account-name {} --account-key {} --name {}

Expected Behavior

Environment Summary

Linux-4.4.0-19041-Microsoft-x86_64-with-fedora-31-Generic
Python 3.7.6

azure-cli 2.1.0 *

Extensions:
azure-devops 0.17.0

Additional Context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ElvenSpellmakercommented, Jan 6, 2021

I ran into this issue while using an older version of fedoraremix WSL Image. I reset my WSL environment recently and cannot reproduce the issue anymore. If this issue is not reproducible, please feel free to resolve it.

I have the same issue, but resetting really wasn’t an option for me. The problem for me is that the azure-cli from dnf uses the stripped down python3.6 and installing pip manually for this version and then python3.6 -m pip install cffi didn’t work for me.

The solution for me was to uninstall the azure-cli package, and then use the main install of python 3.8 to install azure cli:

dnf uninstall azure-cli
pip install azure-cli
hash -r
1reaction
leonheesscommented, May 3, 2021

I can reproduce this consistently on fedoraremix WSL2 and could also fix this issue with @ElvenSpellmaker s tip. Please fix the underlying issue tho since this is a workaround at best.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named _cffi_backend - python - Stack Overflow
For python2.x use following command: python -m pip install cffi. for python3.x python3 -m pip install cffi.
Read more >
ModuleNotFoundError: No module named '_cffi_backend ...
Strangely, if I deploy the function from my mac using func azure functionapp publish xxx it does work, even though it seems to...
Read more >
ModuleNotFoundError: No module named '_cffi_backend' - Help
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): ***generates the same error as ......
Read more >
No module named '_cffi_backend' after compiling Python on a ...
_cffi_backend is the core module of CFFI. The Python interpreter (in this case it seems to be a virtualenv at ~/lib/python/venv/asunto) doesn't ...
Read more >
Bug#959911: python3.7: No module named '_cffi_backend'
Package: python3-cryptography. Version: 2.8-4. Severity: important. I am not sure if it is more pertinent to python3-cffi or one of its packages.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found