Comments (4)
This warning comes from gevent
-- This happens if you import the ssl
module (or import any other library that, at some point, imports ssl
) before importing grequests
. The warning was introduced in a recent version of gevent
For example:
# bad
import requests
import grequests
This raises the warning you see. It's a good warning, as this scenario will also lead to misbehavior in using grequests.
Instead, you want to try to make sure you import grequests first before other modules that use patched libraries.
# OK
import grequests
import requests
Key takeaway: make sure that grequests
is imported first.
It's also worth mentioning that grequests
can have conflicts with other packages that use gevent
(or even modules that gevent patches, in some cases). uWSGI could fall into this category, particularly if configured to use gevent. Though, it's not clear that's the case here.
See also: gevent/gevent#1235
from grequests.
Does this warning need to be dealt with?
Other modules are also using gevent, there is always one to import first, right?
from grequests.
Unfortunately, I'm not sure it's possible to say. Really, it depends...
It's hard to predict whether or not the monkey patching between libraries will be compatible... For better or worse, grequests
uses gevent.monkey.patch_all(thread=False, select=False)
This may or may not be compatible with how other libraries expect things to be patched.
That said, grequests
is generally intended to be used in a standalone fashion. It's best to not use it with other packages that also use gevent
or rely on libraries that are patched by gevent.monkey.patch_all(thread=False, select=False)
as they may not behave as expected.
from grequests.
This warning comes from
gevent
-- This happens if you import thessl
module (or import any other library that, at some point, importsssl
) before importinggrequests
. The warning was introduced in a recent version ofgevent
For example:
# bad import requests import grequestsThis raises the warning you see. It's a good warning, as this scenario will also lead to misbehavior in using grequests.
Instead, you want to try to make sure you import grequests first before other modules that use patched libraries.
# OK import grequests import requestsKey takeaway: make sure that
grequests
is imported first.It's also worth mentioning that
grequests
can have conflicts with other packages that usegevent
(or even modules that gevent patches, in some cases). uWSGI could fall into this category, particularly if configured to use gevent. Though, it's not clear that's the case here.See also: gevent/gevent#1235
Thanks!!! It works 😁😁😁
from grequests.
Related Issues (20)
- How to download files and save to local HOT 2
- How to show a status code HOT 2
- Grequests is creating Recursion errors due to invalid monkey patch HOT 3
- response is None HOT 4
- Grequest returns empty generators HOT 2
- How to convert response for a json HOT 1
- limit number of requests per second. HOT 1
- why size is no affect in map? HOT 1
- Add index in imap HOT 3
- Params of get/post functions HOT 3
- Import fails HOT 1
- Grequests warning and crash HOT 3
- Docker crash HOT 2
- Request for image HOT 2
- Append wait time or rate for every thread due to server limits HOT 1
- Python 3.6 the fastest environment?
- Python 3.6 the fastest environment? HOT 2
- gtimeout does not works with imap_enumerated HOT 1
- Flag to print the request being executed HOT 2
- How to ignore SSL cert verification failed in grequests? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grequests.