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.

Github connector: No module named 'jwt'

See original GitHub issue

Description

Please include a summary of the issue.

Just starting with opsdroid to create a github/matrix skill (linking github and matrix), having some functionality like what the github bot did to slack.

Problem is I get an error with the JWT module when starting opsdroid, namely a missing dependency not installed in the virtual environment.

Steps to Reproduce

Please also include relevant information and steps to reproduce the bug/issue.

virtualenv -p python3 opsdroid
source opsdroid/bin/activate
pip install opsdroid[common]

Then create a configuration.yaml file like this:

welcome-message: true
web:
  host: "127.0.0.1"
  port: 8080
connectors:
  github:
    # required
    app_id: 123456
skills:
  hello: {}

opsdroid start will result in this:

[10/10/22 16:01:26] INFO     ========================================                                     logging.py:161
                    INFO     Started opsdroid v0.28.0.                                                    logging.py:162
                    INFO     ========================================                                       utils.py:134
                    INFO     You can customise your opsdroid by modifying your configuration.yaml.          utils.py:135
                    INFO     Read more at: http://opsdroid.readthedocs.io/#configuration                    utils.py:140
                    INFO     Watch the Get Started Videos at: http://bit.ly/2fnC0Fh                         utils.py:143
                    INFO     Install Opsdroid Desktop at:                                                   utils.py:144
                             https://github.com/opsdroid/opsdroid-desktop/releases                                      
                    INFO     ========================================                                       utils.py:150
                    WARNING  No databases in configuration. This will cause skills which store things in   loader.py:359
                             memory to lose data when opsdroid is restarted.                                            
                    ERROR    The following exception was raised while importing connector                  loader.py:112
                             opsdroid.connector.github                                                                  
                    ERROR    No module named 'jwt'                                                         loader.py:117
                    ERROR    Failed to load connector: opsdroid.connector.github.                          loader.py:124
                    ERROR    Module github failed to import.                                               loader.py:495
                    CRITICAL All connectors failed to load.                                                  core.py:137
                    INFO     Exiting application with return code 1

Expected Functionality

Explain what should happen.

Opsdroid should start

Experienced Functionality

Explain what happened instead(Please include the debug log).

Versions

  • Opsdroid version: v0.28.0.
  • Python version: Python 3.8.10
  • OS/Docker version: Ubuntu 20.04.5 LTS

Configuration File

Please include your version of the configuration file below.

welcome-message: true
web:
  host: "127.0.0.1"
  port: 8080
connectors:
  github:
    # required
    app_id: 123456
skills:
  hello: {}

Additional Details

Any other details you wish to include such as screenshots, console messages, etc.

I tried solving the issue by installing jwt or PyJWT (and providing the right github settings), but:

Installing jwt with pip gives en error:

AttributeError: module 'jwt' has no attribute 'encode'

Installing PyJWT gives another error:

AttributeError: 'str' object has no attribute 'decode'

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fraimondocommented, Nov 17, 2022

I’m not using it. It’s just that I saw the diff in #1954 and it’s exactly what I did to fix the issue.

1reaction
fraimondocommented, Nov 16, 2022

It might be the case that PyJWT gets installed as a dependency of a dependency. In my case, it was not installed even with all.

Regarding the decode, I guess #1954 fixes that issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use OAuth to authenticate (No module named jwt ...
Description: Using the following short snippet raises a ModuleNotFoundError: No module named 'jwt.algorthms' oauth = { 'access_token': token ...
Read more >
import jwt ImportError: No module named jwt - Stack Overflow
I have been trying to run this project https://github.com/udacity/FSND-Deploy-Flask- ...
Read more >
Resolve "ImportError: No module named" in AWS Glue
When I try to import extra modules or packages using the AWS Glue Python shell, I get an "ImportError: No module named" response....
Read more >
Troubleshoot Python errors in Azure Functions - Microsoft Learn
"Exception: ModuleNotFoundError: No module named 'module_name'. ... Go to the Issues section on GitHub and search to see whether your issue ...
Read more >
snowflake-connector-python - PyPI
Update Pyarrow version from 0.16.0 to 0.17.0 for Python connector; Remove more restrictive application name enforcement. Missing keyring dependency will not ...
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