odoo mod_wsgi lxml.etree undefined symbol:PyUnicodeUCS2_DecodeLatin1

时间:2016-11-03 16:16:47

标签: python openerp

我尝试配置mod_wsgi来访问odoo,感谢我的域名。 我跟着this tutorial

但是当我访问我的网站时,我收到了这个错误:

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89] mod_wsgi (pid=30445): Target WSGI script '/opt/odoo-v9-prod/openerp-wsgi.py' cannot be loaded as Python module.

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89] mod_wsgi (pid=30445): Exception occurred processing WSGI script '/opt/odoo-v9-prod/openerp-wsgi.py'.

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89] Traceback (most recent call last):

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp-wsgi.py", line 15, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     import openerp

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp/__init__.py", line 58, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     import modules

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp/modules/__init__.py", line 8, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     from . import db, graph, loading, migration, module, registry

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp/modules/graph.py", line 13, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     import openerp.osv as osv

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp/osv/__init__.py", line 4, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     import osv

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp/osv/osv.py", line 4, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     from ..exceptions import except_orm

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]   File "/opt/odoo-v9-prod/openerp/exceptions.py", line 15, in <module>

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89]     from lxml import etree

[Thu Nov 03 16:00:57 2016] [error] [client 176.189.147.89] ImportError: /usr/local/lib/python2.7.9/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: PyUnicodeUCS2_DecodeLatin1

我测试了我的python编码,它是UCS2。 我重新安装了lxml

1 个答案:

答案 0 :(得分:0)

您的mod_wsgi是针对不同的Python安装而编译的,而不是您尝试强制使用的Python虚拟环境,或者它正在查找的Python共享库。更糟糕的是它正在使用的是用不同宽度编译的Unicode字符支持。您需要从源代码卸载mod_wsgi并重新安装mod_wsgi,并根据您想要使用的特定Python版本对其进行编译,如果需要,强制它使用正确的共享库。您可能还需要考虑重新安装自定义Python版本,以使用与通常被视为平台最佳实践的配置一致的配置。 Linux系统通常使用4字节Unicode,而不是2。

有些东西供您阅读:

忽略后者谈论Docker的事实,所有这些都与普通的Python安装相关。