0

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 
Ahmed Wagdi
  • 3,913
  • 10
  • 50
  • 116

1 Answers1

0

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)
Sazzad Hussain
  • 321
  • 1
  • 3
  • 11
  • It is not working too :( still the same error after changing my requirements.txt to match those versions – Ahmed Wagdi Jan 11 '23 at 18:35
  • Django uses its own copy of python which could cause conflicts with your system Python. can you check in your Django project for the correct python version? – Sazzad Hussain Jan 11 '23 at 19:27
  • well, I am running it inside a docker container,, using docker-compose so I think it only deals with a single python version – Ahmed Wagdi Jan 11 '23 at 19:36