Jwt, cryptography, cffi

Hello ,I am using a jwt module in my project.And after compiling I 've got this error:

File "C:\Panda3D-1.10.5-x64\0PROJECTS\mayn_may\gs.py", line 39, in __getSignedJwt
    return jwt.encode(payload, self.pkey, algorithm='RS256')
  File "C:\Panda3D-1.10.5-x64\0PROJECTS\mayn_may\build\__whl_cache__\PyJWT-1.7.1-py2.py3-none-any.whl\jwt\api_jwt.py", line 65, in encode
  File "C:\Panda3D-1.10.5-x64\0PROJECTS\mayn_may\build\__whl_cache__\PyJWT-1.7.1-py2.py3-none-any.whl\jwt\api_jws.py", line 113, in encode
  File "C:\Panda3D-1.10.5-x64\0PROJECTS\mayn_may\build\__whl_cache__\PyJWT-1.7.1-py2.py3-none-any.whl\jwt\algorithms.py", line 205, in prepare_key
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\hazmat\backends\__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 953, in _find_and_load_unlocked
    _call_with_frames_removed(import_, parent)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 219, in _call_with_frames_removed
    return f(*args, **kwds)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\hazmat\backends\openssl\__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\hazmat\backends\openssl\backend.py", line 16, in <module>
    from cryptography import utils, x509
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 1035, in _handle_fromlist
    _call_with_frames_removed(import_, from_name)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 219, in _call_with_frames_removed
    return f(*args, **kwds)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\x509\__init__.py", line 8, in <module>
    from cryptography.x509.base import (
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\x509\base.py", line 18, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\x509\extensions.py", line 20, in <module>
    from cryptography.hazmat.primitives import constant_time, serialization
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 1035, in _handle_fromlist
    _call_with_frames_removed(import_, from_name)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 219, in _call_with_frames_removed
    return f(*args, **kwds)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "C:\Panda3D-1.10.5-x64\python\lib\site-packages\cryptography\hazmat\primitives\constant_time.py", line 11, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
    module = _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
    spec.loader.exec_module(module)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 819, in exec_module
    exec(code, module.__dict__)
  File "cryptography.hazmat.bindings._constant_time", line 1, in <module>
  File "C:\Panda3D-1.10.5-x64\python\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 696, in _load
    return _load_unlocked(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 670, in _load_unlocked
    module = module_from_spec(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 583, in module_from_spec
    module = spec.loader.create_module(spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap_external.py", line 1043, in create_module
    _imp.create_dynamic, spec)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 219, in _call_with_frames_removed
    return f(*args, **kwds)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 983, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Panda3D-1.10.5-x64\python\lib\importlib\_bootstrap.py", line 965, in _find_and_load_unlocked
    raise ModuleNotFoundError(_ERR_MSG.format(name), name=name)
ModuleNotFoundError: No module named '_cffi_backend'

Help me please!

Try adding an explicit import to _cffi_backend to your code to force it to be included. I also recommend upgrading to Panda3D 1.10.6.

@Falcon, was just the one import for _cffi_backend sufficient to get things running for you? The PyInstaller hook suggests there are more hidden imports to deal with along with some package data that needs to be manipulated.

Actually the mistake was not only in setup.py but also in requerements.txt, plus I added import _ssl in setup.py

 'include_modules':{
'Game':['_cffi_backend','_ssl']
}