I have defined a django view that uses scipy.optimize.curve_fit
. This works without problems using the django development server, but when I deploy the Django application with Apache and mod_wsgi the view function gets stuck importing curve_fit:
from scipy.optimize import curve_fit
When this line is removed the rest of the app works well on the Apache server. Why does this line not work with Apache and mod_wsgi?
In your WSGI file you will have something that looks like this:
<VirtualHost>
...
WSGIScriptAlias / /somepath/deployment/wsgi/yoursite.wsgi
</VirtualHost>
You need to add the following line:
<VirtualHost>
...
WSGIScriptAlias / /somepath/deployment/wsgi/yoursite.wsgi
WSGIApplicationGroup %{GLOBAL}
</VirtualHost>
The explanation for that can be found here:
http://mail.scipy.org/pipermail/scipy-user/2011-November/031014.html
many thanks for this post. I had the same Problem with spaCy and fixed it by the
<VirtualHost>
…
WSGIApplicationGroup %{GLOBAL}
</VirtualHost>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With