Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
emma125dgggd opened this issue May 1, 2023 · 22 comments

Comments

@emma125dgggd
Copy link

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
Copy link

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

pip install requests-toolbelt==0.10.1

@eric-truss
Copy link

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
Copy link

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
Copy link
Author

emma125dgggd commented May 7, 2023

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
Copy link

facing the same issue

@Moinshaikh2602
Copy link

facing the same issue

Add these dependencies in requirements.txt

requests-toolbelt==0.10.1 
requests==2.29.0 
urllib3 

@anupamkayal
Copy link

anupamkayal commented May 14, 2023

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
Copy link
Owner

fixed in v4.7.0

@Moinshaikh2602
Copy link

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
Copy link

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

@boyintheroom
Copy link

boyintheroom commented May 16, 2023

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
Copy link

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
Copy link

@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
Copy link

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
Copy link

Xpl0itU commented May 19, 2023

Still happening even after 4.7.0

@AlejandroPG10
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

kwkbtr commented Jun 12, 2023

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

@nhorvath
Copy link
Owner

nhorvath commented Jun 12, 2023 via email

@nhorvath
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests