Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Graham Dumpleton
The only thing which doesn't apply in your case is that the examples use: Order allow,deny Allow from all This is old Apache 2.2 way of doing it. Use what you have now for Apache 2.4 of: Require all granted The comment about being out of date is more that there are various new features

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Graham Dumpleton
> On 14 Jun 2018, at 6:06 pm, Rajeev Jain wrote: > > Enabling WSGI on Apache2/Ubuntu16.04 is a very popular configuration. It > should not be this difficult. It was complicated by starting out with trying to use Anaconda Python. That has confused things along the way. > What python version

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Rajeev Jain
Enabling WSGI on Apache2/Ubuntu16.04 is a very popular configuration. It should not be this difficult. What python version do you want me to use? Where do you want it installed? Please tell me precisely what steps to follow to get this running? Please send me the following 2 files correctly and

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Graham Dumpleton
Check your wsgi.load contents is correct. Ie., current output of running: mod_wsgi-express module-config for version installed in system Python 3.6. Check that mods-enabled is symlink to it and not copy with wrong value. The error indicates module wasn't loaded. > On 14 Jun 2018, at 5:09

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Graham Dumpleton
Do: pip uninstall mod_wsgi Repeat until says not installed. Then reinstall it. Run 'ldd' on the mod_wsgi .so file that is built to see what Python shared library it is finding. The installed version is possibly compiled against Anaconda Python somehow. Also do a complete Apache stop and

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Rajeev Jain
here is updated flask.wsgi here is error.log [Wed Jun 13 23:23:03.445837 2018] [wsgi:error] [pid 4758] ModuleNotFoundError: No module named 'math' [Wed Jun 13 23:23:15.854525 2018] [wsgi:error] [pid 4758] VERSION 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:17:00) [Wed Jun 13

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-14 Thread Rajeev Jain
on Jun 13, 2018, at 10:58 PM, Graham Dumpleton wrote: Instead then. Print out sys.path from the interpreter and then also from your WSGI script file. python Python 3.6.5 (default, May 3 2018, 10:08:28) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
Instead then. Print out sys.path from the interpreter and then also from your WSGI script file. > On 14 Jun 2018, at 3:56 pm, Rajeev Jain wrote: > > root is not enabled. but i guess i can enable it for testing purposes. > > On Jun 13, 2018, at 10:55 PM, Graham Dumpleton

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
root is not enabled. but i guess i can enable it for testing purposes. On Jun 13, 2018, at 10:55 PM, Graham Dumpleton wrote: >From root, can you su to the user for Apache and try the same thing. Graham > On 14 Jun 2018, at 3:54 pm, Rajeev Jain > wrote: > > yes. >

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
>From root, can you su to the user for Apache and try the same thing. Graham > On 14 Jun 2018, at 3:54 pm, Rajeev Jain wrote: > > yes. > > /etc/apache2/sites-available$ python > Python 3.6.5 (default, May 3 2018, 10:08:28) > [GCC 5.4.0 20160609] on linux > Type "help", "copyright",

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
yes. /etc/apache2/sites-available$ python Python 3.6.5 (default, May 3 2018, 10:08:28) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> —Rajeev On Jun 13, 2018, at 10:52 PM, Graham Dumpleton wrote: Odd. If you

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
Odd. If you run python3.6 and enter in the interpreter: import datetime it works? Graham > On 14 Jun 2018, at 3:50 pm, 'Rajeev Jain' via modwsgi > wrote: > > > On Jun 13, 2018, at 10:42 PM, Graham Dumpleton > wrote: > > How did you install Python

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
> > Latest update: >> > No virtual environment. Python3.6 is now installed into the system folder: python location: */etc/apache2/sites-available*$ python --version Python 3.6.5 python Python 3.6.5 (default, May 3 2018, 10:08:28) [GCC 5.4.0 20160609] on linux Type "help", "copyright",

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
To be clear, I'll create a virtual environment and use standard python3.6 distribution (i.e. non anaconda). I'll follow the suggestions you have laid out here... On Wednesday, June 13, 2018 at 6:50:48 PM UTC-7, Graham Dumpleton wrote: > > Using a virtual environment will not help if you intend

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
Using a virtual environment will not help if you intend to still use Anaconda Python. You will still have the issue with the SSL libraries. Are you thinking that a virtual environment will somehow solve the problem? > On 14 Jun 2018, at 11:34 am, Rajeev Jain wrote: > > I want to thank you for

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
I want to thank you for the time you spent with me. It is clear, using Anaconda with Apache is not a good idea. My objective now is to setup a virtual environment, and then configure a Apache virtual host to use it. There is a multitude of half complete solutions out there to accomplish this.

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
> On 14 Jun 2018, at 11:04 am, Rajeev Jain wrote: > > Here is a more complete error log: > > [Wed Jun 13 17:55:33.173679 2018] [mpm_prefork:notice] [pid 2174] AH00169: > caught SIGTERM, shutting down > [Wed Jun 13 17:55:34.421101 2018] [mpm_prefork:notice] [pid 2501] AH00163: >

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
FYI, */etc/apache2/mods-available*$ ls access_compat.load authn_file.load cache_disk.conf deflate.conf heartmonitor.load macro.loadphp7.0.load proxy.load session.load suexec.load actions.confauthn_socache.load

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
Here is a more complete error log: [Wed Jun 13 17:55:33.173679 2018] [mpm_prefork:notice] [pid 2174] AH00169: caught SIGTERM, shutting down [Wed Jun 13 17:55:34.421101 2018] [mpm_prefork:notice] [pid 2501] AH00163: Apache/2.4.18 (Ubuntu) mod_wsgi/4.6.4 Python/3.6 configured -- resuming normal

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
There may be another Apache module which is dragging in the SSL libraries. Is PHP module enabled? What modules are linked in the 'mods-enabled' directory? Graham > On 14 Jun 2018, at 10:54 am, Rajeev Jain wrote: > > It is probably better to have run: > > mod_wsgi-express module-config >

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
> > It is probably better to have run: > > mod_wsgi-express module-config > > That should give you a LoadModule line for loading the mod_wsgi.so file > from the place it is installed, as well as a LoadFile which loads the > correct Python shared library for Anaconda, so the system Python

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
Comments inline. > On 14 Jun 2018, at 8:52 am, Rajeev Jain wrote: > > So you know for future. In a multi part email chain it can be difficult to go > back and extract what configuration may have been used that you might be > referring to. So when you ask questions you should always repeat

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
> > So you know for future. In a multi part email chain it can be difficult to > go back and extract what configuration may have been used that you might be > referring to. So when you ask questions you should always repeat what is > occurring in your case. It is even better not to reply on a

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
> On 13 Jun 2018, at 6:38 pm, Rajeev Jain wrote: > > Your point is well taken. Its 100% the exact same situation. Same objective, > appears to be a similar software setup and same exact error. No need to > repeat what has already been stated. So you know for future. In a multi part email

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
Your point is well taken. Its 100% the exact same situation. Same objective, appears to be a similar software setup and same exact error. No need to repeat what has already been stated. error I'm trying to resolve: Wed Jun 13 00:15:55.875613 2018] [mpm_prefork:notice] [pid 5367] AH00163:

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Graham Dumpleton
You are better off restating your problem from scratch, with errors you see, any configuration etc. One cannot assume it is the same problem. So do that and can then help. Graham > On 13 Jun 2018, at 6:24 pm, Rajeev Jain wrote: > > HI, Did yu have any luck? I'm having the same exact issue. >

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2018-06-13 Thread Rajeev Jain
HI, Did yu have any luck? I'm having the same exact issue. best, -R On Thursday, May 11, 2017 at 1:34:33 PM UTC-7, Brian wrote: > > Graham, > > Thank you so much. I plan to use Anaconda for this project and so maybe > using another tool is best? I don't want to give up on this direction if >

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-11 Thread Graham Dumpleton
If want to use conda env, just try it. Differences are: 3. Activate conda env. 8. Do same, but just use directory that 'sys.prefix' refers to for conda env. It is quite likely it will work, I just don't remember right now and can't quickly test. Graham > On 12 May 2017, at 6:34 AM, Brian

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-11 Thread Brian
Graham, Thank you so much. I plan to use Anaconda for this project and so maybe using another tool is best? I don't want to give up on this direction if you think it will be fruitful, but maybe nginx + gunicorn + flask in a conda installed env is better? I'm even considering just deploying to

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-09 Thread Graham Dumpleton
If you want to use Anaconda Python with mod_wsgi, the steps you need to follow are as follows. 1. Uninstall any system wide mod_wsgi package as you do not need it and it can interfere. sudo apt-get uninstall libapache2-mod-wsgi 2. Ensure 'dev' packages for Python and Apache installed.

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-08 Thread Graham Dumpleton
Just read again. You are using system package for mod_wsgi, not that installed for Anaconda. You should not be using both installs. Will send back instructions later when have time. Graham > On 9 May 2017, at 6:47 AM, Brian wrote: > > Thanks Graham. > > I did

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-08 Thread Brian
Thanks Graham. I did edit the FlaskApp.config file: ServerName .us-west-2.compute.amazonaws.com ServerAdmin ubuntu@ec2- .us-west-2.compute.amazonaws.com WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-08 Thread Graham Dumpleton
Did you read: http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html as I linked to. There is no evidence that you have added anything for a Python virtual environment if you are

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-08 Thread Brian
The conda environment must not be set correctly because it can't find flask: [Mon May 08 16:39:11.002873 2017] [:error] [pid 31696:tid 139896253531904] [client 208.184.3.194:36413] Traceback (most recent call last): [Mon May 08 16:39:11.002923 2017] [:error] [pid 31696:tid 139896253531904]

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-08 Thread Brian
Note: the previous question is also on SO . Best, -Brian On Monday, May 8, 2017 at 10:59:16 AM UTC-6, Brian wrote: > > Thank you Graham. > > Any recs on testing and/or

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-08 Thread Brian
Thank you Graham. Any recs on testing and/or debugging a 500 internal server error when I try to hit the site? I'm assuming that it's in the configuration so I'm going to add full details of the process and config files below. All commands ran: ## build conda environment conda create

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-07 Thread Graham Dumpleton
In the first instance you should ensure things work with a WSGI hello world, no Flask framework. This ensures setup with Anaconda Python is okay, which sometimes doesn't always work because of stupid things Anaconda Python does which breaks the ability to use it in embedded systems. As to

Re: [modwsgi] how to use python 3.6.1 in an anaconda3 env w/ Apache + mod_wsgi + flask on aws ubuntu ec2 instance

2017-05-04 Thread Graham Dumpleton
As per instructions in: https://pypi.python.org/pypi/mod_wsgi You need to ensure you have the 'dev' packages for Apache installed. If you are running Debian or Ubuntu Linux with Apache 2.4 system packages, regardless of which Apache MPM is being