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.

Cannot use the cryptography package: No module named 'setuptools_rust'

See original GitHub issue

I have cryptography==3.4.7 in my requirements.txt which results in this error:

Finished cargoSetupPostPatchHook
configuring
no configure script, doing nothing
building
Executing setuptoolsBuildPhase

        =============================DEBUG ASSISTANCE==========================
        If you are seeing an error here please try the following to
        successfully install cryptography:

        Upgrade to the latest pip and try again. This will fix errors for most
        users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
        =============================DEBUG ASSISTANCE==========================
        
Traceback (most recent call last):
  File "nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "setup.py", line 14, in <module>
    from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
builder for '/nix/store/kj5y3d9i4h56rsa69v6dr0cf792lrv4n-python3.8-cryptography-3.4.7.drv' failed with exit code 1
cannot build derivation '/nix/store/cxgf9v895i1ig5l4mzklvp51a54nc36k-python3-3.8.9-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/cxgf9v895i1ig5l4mzklvp51a54nc36k-python3-3.8.9-env.drv' failed

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tfmoraescommented, Aug 26, 2021

Adding setuptools_rust to requirements fixes this problem to me.

0reactions
pmiddendcommented, Aug 27, 2021

Adding setuptools_rust to requirements fixes this problem to me.

Indeed, for now, this works! I’ll keep this issue open until the problem is properly fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named 'setuptools_rust' with cryptography==3.4
EDIT: tl;dr: run "pip install --upgrade pip". You don't need to install Rust! Use --prefer-binary to make sure you're not rebuilding from ...
Read more >
Python 3.6.9 . ImportError: No module named setuptools_rust ...
Try installing setuptools_rust first: pip install setuptools_rust. And then installing pyOpenSSL again.
Read more >
Fix the “no module named” error in Python - Anto Online
This post will show you how to fix the “ModuleNotFoundError: No module” error. This example will focus on no module named setuptools_rust on...
Read more >
No module named 'setuptools_rust' while running pip3 install ...
Try `pip3 install --user` instead.​​ successfully install cryptography: Upgrade to the latest pip and try again. This will fix errors for most ...
Read more >
No Module Named 'setuptools_rust' in Python - Finxter
Quick Fix: Python raises the ImportError: No module named 'setuptools_rust' when it cannot find the library setuptools_rust . The most frequent source of ......
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