Config:
Ubuntu 16.04 LTS x64
Apache/2.4.18
libapache2-mod-wsgi-py3 4.3.0-1.1build1 amd64
Python 3.4.6 (compiled from sources)
Pyramid running Python 3.4.6-based Virtualenv
myapp.wsgi file contains:
venv = '/path-to-venv/bin/activate_this.py'
exec(open(venv).read())
from pyramid.paster import get_app, setup_logging
...
Same result when enabling/disabling venv activation by code within myapp.wsgi, i.e. still crashing on 'from pyramid.paster...' line:
ImportError: No module named 'pyramid'
/etc/apache2/sites-available/myapp.conf:
ServerName myapp.localhost
DocumentRoot /path-to-myapp-project/
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=me group=me threads=4 \
python-path=~/path-to-venv/lib/python3.4/site-packages
WSGIScriptAlias / /path-to-myapp-project/myapp.wsgi
<Directory /path-to-myapp-project/>
WSGIProcessGroup pyramid
Order deny,allow
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/myapp.localhost-error.log
CustomLog ${APACHE_LOG_DIR}/myapp.localhost-access.log combined
Any tips ?
While trying to pip install mod_wsgi in a new virtualenv located outside my home dir, it crashes with:
/usr/bin/ld: /usr/bin/python3.4.6/lib/libpython3.4m.a(abstract.o): réadressage de R_X86_64_32S en vertu de « _Py_NotImplementedStruct » ne peut être utilisé lors de la création d'un objet partagé; recompilez avec -fPIC
/usr/bin/python3.4.6/lib/libpython3.4m.a : erreur lors de l'ajout de symboles : Mauvaise valeur
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anvenv/venv_py3.4.6/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-svro6spq/mod-wsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jfm8wwoj-record/install-record.txt --single-version-externally-managed --compile --install-headers /anvenv/venv_py3.4.6/include/site/python3.4/mod-wsgi" failed with error code 1 in /tmp/pip-build-svro6spq/mod-wsgi/
~
in a path in Apache configuration. modwsgi.readthedocs.io/en/develop/user-guides/… – Graham Dumpleton