python3.5安装Django1.9.6时出错:语法错误

时间:2016-11-11 08:49:14

标签: python django apache mod-wsgi

当我调用server.apache错误日志时。我试着解决它,但我失败了。希望有人可以帮助我。非常感谢你。

                SQLiteConnectionStringBuilder builder = new SQLiteConnectionStringBuilder
                {
                    Pooling = true
                };

这是我的python版本。

Traceback (most recent call last):
File "/var/www/DjangoBlog/weblog/config/wsgi.py", line 19, in <module>
from django.core.wsgi import get_wsgi_application
File "/usr/local/python3/lib/python3.5/site-packages/django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/version.py", line 7, in <module>
from django.utils.lru_cache import lru_cache
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/lru_cache.py", line 28
fasttypes = {int, str, frozenset, type(None)},
            ^
SyntaxError: invalid syntax

这是我的http.conf

 python -V
 Python 3.5.1

1 个答案:

答案 0 :(得分:3)

即使你已经将mod_wsgi配置中的Python路径设置为指向3.5个站点包,mod_wsgi本身仍然使用Python 2.6或更早版本,它不理解set literals。

你需要一个针对Python 3.5编译的mod_wsgi版本。