pyinstaller / pyinstaller/pyinstaller

pynacl is missing the cffi backend

Open
#3,525 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area:hooks move-to-contrib pull-request wanted
Dominant language
Python
Stars
13.1k
Forks
2k
Avg merge
1d 3h
Merged PRs (30d)
11

Description

Python 3.6.5, 64 Bit
Pyinstaller develop.zip version

the project uses pynacl, however the cffi backend does not get included.

Traceback (most recent call last):
  File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 712, in load_module
    module = loader.load_module(fullname)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ModuleNotFoundError: No module named '_cffi_backend'

During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "main.py", line 98, in <module>
  File "main.py", line 36, in check_licence
  File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 628, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\nacl\signing.py", line 19, in <module>
  File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 628, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\nacl\bindings\__init__.py", line 17, in <module>
  File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 628, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\nacl\bindings\crypto_box.py", line 18, in <module>
  File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
    raise ImportError('%s: %s' % (e, fullname))
ImportError: No module named '_cffi_backend': nacl._sodium
[2768] Failed to execute script main

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the reported Python 3.6.5 setup and PyInstaller develop.zip, starting from the loader traceback and site-packages/nacl/bindings/crypto_box.py. Trace how the PyInstaller bundle discovers nacl._sodium and _cffi_backend; done means the bundled application imports PyNaCl without the reported ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.