nhorvath / Pyrebase4

A simple python wrapper for the Firebase API. ⛺
248 stars 61 forks source link

Library needs to be updated. Requests- Toolsbelt was updated today and Pyrebase4 now throws import error #62

Closed emma125dgggd closed 1 year ago

emma125dgggd commented 1 year ago

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script exec(code, module.dict) File "/app/cleeve-2/main.py", line 35, in import pyrebase File "/home/appuser/venv/lib/python3.9/site-packages/pyrebase/init.py", line 1, in from .pyrebase import initialize_app File "/home/appuser/venv/lib/python3.9/site-packages/pyrebase/pyrebase.py", line 20, in from requests_toolbelt.adapters import appengine File "/home/appuser/venv/lib/python3.9/site-packages/requests_toolbelt/adapters/appengine.py", line 42, in from .._compat import gaecontrib

GitMarco27 commented 1 year ago

Downgrading requests-toolbelt to the previous version fixes the problem for the moment:

pip install requests-toolbelt==0.10.1

eric-truss commented 1 year ago

To add onto this, looks like Requests was also updated today to add support for urllib3 2.0 and has some "minor breaking changes": https://github.com/psf/requests/releases/tag/v2.30.0

In order to fix that, pin to the previous version of requests: requests==2.29.0

Moinshaikh2602 commented 1 year ago

To add onto this, looks like Requests was also updated today to add support for urllib3 2.0 and has some "minor breaking changes": https://github.com/psf/requests/releases/tag/v2.30.0

In order to fix that, pin to the previous version of requests: requests==2.29.0

Thank you , I was getting same issue

emma125dgggd commented 1 year ago

To add onto this, looks like Requests was also updated today to add support for urllib3 2.0 and has some "minor breaking changes": https://github.com/psf/requests/releases/tag/v2.30.0

In order to fix that, pin to the previous version of requests: requests==2.29.0

doesn't work at my end File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

exec(code, module.__dict__)

File "main.py", line 35, in

import pyrebase

File "/home/appuser/venv/lib/python3.9/site-packages/pyrebase/init.py", line 1, in

from .pyrebase import initialize_app

File "/home/appuser/venv/lib/python3.9/site-packages/pyrebase/pyrebase.py", line 19, in

from requests.packages.urllib3.contrib.appengine import is_appengine_sandbox

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

MasterPhoton commented 1 year ago

facing the same issue

Moinshaikh2602 commented 1 year ago

facing the same issue

Add these dependencies in requirements.txt

requests-toolbelt==0.10.1 
requests==2.29.0 
urllib3 
anupamkayal commented 1 year ago

facing the same issue

Add these dependencies in requirements.txt

requests-toolbelt==0.10.1 
requests==2.29.0 
urllib3 

Yes, you are right but if the problem exists then install this library separately such as

pip install requests==2.29.0
nhorvath commented 1 year ago

fixed in v4.7.0

Moinshaikh2602 commented 1 year ago

fixed in v4.7.0

Still getting this error after updating version

InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load : cannot import name 'gaecontrib' from 'requests_toolbelt._compat' (/usr/local/lib/python3.9/site-packages/requests_toolbelt/_compat.py)

when i freeze the versions of other packages it will worked

requests-toolbelt==0.10.1
requests==2.29.0
urllib3
nhorvath-bowery commented 1 year ago

That is exactly what is in requirements.txt now (even though it's bad practice and should be changed)

boyintheroom commented 1 year ago

That is exactly what is in requirements.txt now (even though it's bad practice and should be changed)

@nhorvath hi. what is the purpose of requirements.txt? im new. also i have kivmob master. it installs latest version of requests and requests_toolbelt everytime i build my kivy app. i have defined the versions in buildozer.spec also but still shows the error of ModuleNotFoundError: No module named 'requests.packages.urllib3.contrib.appengine'

AsifArmanRahman commented 1 year ago

what is the purpose of requirements.txt?

The requirements.txt file is used for specifying what python packages are required to run the project. It stores the information of what packages with specified versions are needed for running the project.

it installs latest version of requests and requests_toolbelt everytime

The latest version of these library has a breaking change, and that change is causing the error you're facing.

boyintheroom commented 1 year ago

@AsifArmanRahman Hi, thankyou for replying. can you tell me how can i add requests and toolbelt versions to my requirements.txt file. so that they wont show error 'in question at top' on running my android app.

AsifArmanRahman commented 1 year ago

Based on the deps of the libraries you're using to build your app; it could be because of that. Find a suitable version of libraries which work with the exact version of the 3 mentioned libraries in your original question.

Xpl0itU commented 1 year ago

Still happening even after 4.7.0

AlejandroPG10 commented 1 year ago

I'm trying to compile my apk and apk crashes on android. I already know that this is related to the problem you're talking about. I was using pyrebase 4.6.0. Can anybody tell me what I have to specified on my buildozer.spec (requirements)? Which versions of these libraries I have to use?

I tried with the version of the packs you wrote on this post but does not work for me.

Thank you in advance.

Moinshaikh2602 commented 1 year ago

I'm trying to compile my apk and apk crashes on android. I already know that this is related to the problem you're talking about. I was using pyrebase 4.6.0. Can anybody tell me what I have to specified on my buildozer.spec (requirements)? Which versions of these libraries I have to use?

I tried with the version of the packs you wrote on this post but does not work for me.

Thank you in advance.

requests-toolbelt==0.10.1
requests==2.29.0
urllib3
AlejandroPG10 commented 1 year ago

I'm trying to compile my apk and apk crashes on android. I already know that this is related to the problem you're talking about. I was using pyrebase 4.6.0. Can anybody tell me what I have to specified on my buildozer.spec (requirements)? Which versions of these libraries I have to use? I tried with the version of the packs you wrote on this post but does not work for me. Thank you in advance.

requests-toolbelt==0.10.1
requests==2.29.0
urllib3

I tried like this with pyrebase 4.6.0. It is necessary to use 4.7.0? I've read some comments about it but I don't know if by installing the new version I'm going to solve it

Moinshaikh2602 commented 1 year ago

I'm trying to compile my apk and apk crashes on android. I already know that this is related to the problem you're talking about. I was using pyrebase 4.6.0. Can anybody tell me what I have to specified on my buildozer.spec (requirements)? Which versions of these libraries I have to use? I tried with the version of the packs you wrote on this post but does not work for me. Thank you in advance.

requests-toolbelt==0.10.1
requests==2.29.0
urllib3

I tried like this with pyrebase 4.6.0. It is necessary to use 4.7.0? I've read some comments about it but I don't know if by installing the new version I'm going to solve it

No , for now you have to install these 3 packages with pyrebase 4.6.0 and 4.7.0

You can read some comments above for more details

kwkbtr commented 1 year ago

Changing versions in requirements.txt doesn't affect user installation. install_requires in setup.py should be updated to fix user installation.

nhorvath commented 1 year ago

Thanks... I can't belive I missed that. Will fix today.

On Mon, Jun 12, 2023, 12:21 AM KAWAKUBO Toru @.***> wrote:

Changing versions in requirements.txt doesn't affect user installation. install_requires in setup.py should be updated to fix user installation.

— Reply to this email directly, view it on GitHub https://github.com/nhorvath/Pyrebase4/issues/62#issuecomment-1586555357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABIJXATKN2PR4FA3WFTGMTXK2KLZANCNFSM6AAAAAAXSGMCF4 . You are receiving this because you were mentioned.Message ID: @.***>

nhorvath commented 1 year ago

Fixed requirements in https://pypi.org/manage/project/Pyrebase4/release/4.7.1/ thanks for the help.