Re: [modwsgi] Python requests module issue

2017-09-28 Thread Graham Dumpleton
What do you get if you add: import sys import requests print(type(sys.modules['requests']) print(type(requests)) It looks a bit like some fancy is being done with delayed module loader as a real module should have a __file__ attribute. Graham > On 29 Sep 2017, at 8:56 am,

Re: [modwsgi] Python requests module issue

2017-09-28 Thread Chris Barton
Hi Graham, Here's what we're getting when we attempt to access the __file__ attribute of the imported requests library: [Thu Sep 28 15:37:30.406608 2017] [wsgi:info] [pid 9408:tid 139645478971136] mod_wsgi (pid=9408): Create interpreter 'dev.api.serviceoperations.mydomain.com|'. [Thu Sep 28

Re: [modwsgi] Python requests module issue

2017-09-28 Thread Chris Barton
Hi Bill, Thanks for your reply. This was one of the first things we looked at a week or two ago. We even tried importing requests as a different module name. This exact same code will run properly when the Flask module is run directly with the python interpreter from our virtualenv. If we

Re: [modwsgi] Python requests module issue

2017-09-28 Thread Graham Dumpleton
> On 29 Sep 2017, at 5:51 am, Bill Freeman wrote: > > Do you have a module of your own named "requests" that is being confused, > somehow, with the installed package? > Or might you be importing something "as requests"? The way to determine that is to add somewhere in your

Re: [modwsgi] Python requests module issue

2017-09-28 Thread Bill Freeman
Do you have a module of your own named "requests" that is being confused, somehow, with the installed package? Or might you be importing something "as requests"? On Thu, Sep 28, 2017 at 12:02 PM, Chris Barton < ch...@chrisbartonphotography.com> wrote: > Hello, > > I've been working on the

[modwsgi] Python requests module issue

2017-09-28 Thread Chris Barton
Hello, I've been working on the deployment of a Flask application using mod_wsgi4.5.18 (compiled against Python3.6.1) and have been encountering issues with the requests library that only seem to manifest when the Flask app is run from behind Apache & mod_wsgi. When the app is invoked from the