Ahmed Wagdi
Ahmed Wagdi

Reputation: 4421

ModuleNotFoundError: No module named 'requests.adapters' when using pyfcm

I'm trying to use pyfcm library in my django project , by adding it to requiements.txt but I noticed that it is getting an error that mainly comes because of trying to import from requests library .. here is the error :

rolla_django       |     from pyfcm import FCMNotification
rolla_django       |   File "/usr/local/lib/python3.10/dist-packages/pyfcm/__init__.py", line 14, in <module>
rolla_django       |     from .fcm import FCMNotification
rolla_django       |   File "/usr/local/lib/python3.10/dist-packages/pyfcm/fcm.py", line 1, in <module>
rolla_django       |     from .baseapi import BaseAPI
rolla_django       |   File "/usr/local/lib/python3.10/dist-packages/pyfcm/baseapi.py", line 6, in <module>
rolla_django       |     from requests.adapters import HTTPAdapter
rolla_django       | ModuleNotFoundError: No module named 'requests.adapters'

and here is my requirements.txt

Django~=4.1.1
djangorestframework~=3.13.1
django-extensions
pymysql~=1.0.2
requests
tzdata
psycopg2-binary
django-crontab
pyfcm 

Upvotes: 0

Views: 455

Answers (1)

Sazzad Hussain
Sazzad Hussain

Reputation: 321

You can try these things

  1. Update pyfcm to the latest version (1.5.4)
  2. Update requests to the latest version (2.28.1)

Upvotes: 0

Related Questions