Pyrebase icon indicating copy to clipboard operation
Pyrebase copied to clipboard

ImportError: No module named 'requests.packages.urllib3.contrib.appengine'

Open anomaddev opened this issue 8 years ago • 8 comments

Hey,

Working on a pi setup to control my outdoor hydroponics garden and I'm just now getting an error when running my script. Here's the error: pi@gardenpi:~/GardenPi $ sudo python3 testing.py Traceback (most recent call last): File "testing.py", line 2, in <module> import pyrebase File "/usr/local/lib/python3.4/dist-packages/pyrebase/__init__.py", line 1, in <module> from .pyrebase import initialize_app File "/usr/local/lib/python3.4/dist-packages/pyrebase/pyrebase.py", line 19, in <module> from requests.packages.urllib3.contrib.appengine import is_appengine_sandbox ImportError: No module named 'requests.packages.urllib3.contrib.appengine'

I saw an issue with this that was dated back in 2016, but the solution was running the code with Python3 with I am already doing. Any help with this would be great!

Thanks, Justin

anomaddev avatar Apr 15 '17 06:04 anomaddev

It looks like the latest pyrebase doesn't play nice with the latest requests package. Install the requests version that is listed in requirements.txt instead (worked for me)

robertlayton avatar May 01 '17 00:05 robertlayton

Hi @robertlayton, I am running into this same runtime error. I moved my app's files to my new Raspberry Pi from my old one (old Ubuntu 64 -> new Raspberry Pi OS 64). When I start my app in a docker container (I use docker-compose) I get this same error message on importing Pyrebase4.

I am not sure why I would be able to build and run my app successfully on my old device on Ubuntu 64 (which also has older versions of docker/docker-compose) but not on my new device on Pi OS...

Here are my dependencies/requirements.txt installed in the container: APScheduler==3.10.1 debugpy==1.6.7 df2img==0.2.10 emoji==2.2.0 httpx==0.23.3 ipython==8.12.0 nbformat==5.8.0 nextcord==2.4.2 nextcord-ext-menus==1.5.6 pandas==2.0.0 Pyrebase4==4.6.0 quart==0.18.3 yt-dlp==2023.3.4

I have tried reinstalling docker and using different versions (also made sure to be using the aarch64 docker versions as I am now on Pi OS 64).

cgoulart35 avatar May 05 '23 15:05 cgoulart35

Hi @robertlayton, I am running into this same runtime error. I moved my app's files to my new Raspberry Pi from my old one (old Ubuntu 64 -> new Raspberry Pi OS 64). When I start my app in a docker container (I use docker-compose) I get this same error message on importing Pyrebase4.

I am not sure why I would be able to build and run my app successfully on my old device on Ubuntu 64 (which also has older versions of docker/docker-compose) but not on my new device on Pi OS...

Here are my dependencies/requirements.txt installed in the container: APScheduler==3.10.1 debugpy==1.6.7 df2img==0.2.10 emoji==2.2.0 httpx==0.23.3 ipython==8.12.0 nbformat==5.8.0 nextcord==2.4.2 nextcord-ext-menus==1.5.6 pandas==2.0.0 Pyrebase4==4.6.0 quart==0.18.3 yt-dlp==2023.3.4

I have tried reinstalling docker and using different versions (also made sure to be using the aarch64 docker versions as I am now on Pi OS 64).

Think I figured out the issue. https://github.com/cgoulart35/GBot/commit/8918e6842acd7b08cda3fa26b0350f406bbe3f50

https://stackoverflow.com/questions/76175487/sudden-importerror-cannot-import-name-appengine-from-requests-packages-urlli

cgoulart35 avatar May 06 '23 18:05 cgoulart35

Hey my python version is 3.11.4 and I'm getting the same error ModuleNotFoundError: No module named 'requests.packages.urllib3.contrib.appengine Could you guys help me to solve it??

Siam-Rayhan1 avatar Nov 18 '23 07:11 Siam-Rayhan1

Hey my python version is 3.11.4 and I'm getting the same error ModuleNotFoundError: No module named 'requests.packages.urllib3.contrib.appengine Could you guys help me to solve it??

were you able to solve? i have the same problem

TLBritts123 avatar Nov 30 '23 00:11 TLBritts123

Try this firebase-rest-api

AsifArmanRahman avatar Dec 02 '23 21:12 AsifArmanRahman

I've solved in this way https://stackoverflow.com/questions/78017690/python-telegram-bot-v13-11-incompatible-with-requests-and-urllib3-libraries-usin/78017691#78017691

Helias avatar Feb 19 '24 10:02 Helias

ys help me to solv

pip install urllib3==1.26.15

stagebo avatar Sep 03 '24 08:09 stagebo

ys help me to solv

pip install urllib3==1.26.15

Downgrading the urllib3 into 1.26.x version will resolve the issue on the system. As I was using pyrebase4 with Kivy for my Android buildozer project downgrading resolved my error ModuleNotFoundError 'urllib3.contrib.appengine' but other import errors appeared.

so if anyone is finding the solution for Pyrebase4 on buildozer check the attached link below as it resolved my issue.

https://codebitmatrix.com/how-to-integrate-firebase-with-python-android-app-by-using-pyrebase-kivy-buildozer/

Suleman-Tariq avatar Nov 28 '24 20:11 Suleman-Tariq

Since Pyrebase is no longer maintained, it might be better to switch to Pyrebase4, a fork of the original Pyrebase. The existing code doesn't need any changes—just update the import

devded avatar Nov 29 '24 09:11 devded