Github connector: No module named 'jwt'
See original GitHub issueDescription
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:
- Created a year ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
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.
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.