导入pyodbc时,apache2 mod_wsgi崩溃 [英] apache2 mod_wsgi crashes when importing pyodbc
问题描述
操作系统-Azure VM上的Ubuntu Server 14.04
Operating system - Ubuntu Server 14.04 on Azure VM
尝试使用不同版本的python(3.4.3、3.6.0),apache和mod_wsgi.
Tried with different versions of python (3.4.3, 3.6.0), apache and mod_wsgi.
使用此处的说明安装MS Native ODBC驱动程序 https://gist.github.com/joecampo/6f777a659b8132b9d6fe1c3589df394c ,同时使用pyodbc进行安装
Installed MS Native ODBC driver using instructions from here https://gist.github.com/joecampo/6f777a659b8132b9d6fe1c3589df394c , while pyodbc was installed using pip.
要调试wsgi_module,我已将django应用程序设置为以嵌入式模式运行,并且:
To debug the wsgi_module I have set up the django application to run in embedded mode and:
gdb /usr/local/apache2/bin/httpd
run -X
当我访问导入pyodbc的任何函数时,wsgi失败,并出现以下错误:
When I access any function which imports pyodbc, the wsgi fails with the following error:
Program received signal SIGSEGV, Segmentation fault.
import_types () at src/pyodbcmodule.cpp:223
223 src/pyodbcmodule.cpp: No such file or directory.
当我从命令行运行django应用程序时,导入模块工作正常:
Importing module works fine when I run the django app from the command line:
python3 manage.py runserver
有解决方法吗?
推荐答案
此问题已在4.0.16中通过添加对子解释器的支持进行了修复.
This has been fixed in 4.0.16 by adding support for subinterpreters.
这篇关于导入pyodbc时,apache2 mod_wsgi崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!