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

python3.5 Error installing Django1.9.6: syntax error

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

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

这是我的 python 版本。

 python -V
 Python 3.5.1

这是我的http.conf

Listen 81
WSGIPythonPath /usr/local/python3/lib/python3.5/site-packages
<VirtualHost *:81>

WSGIScriptAlias / /var/www/DjangoBlog/weblog/config/wsgi.py

ErrorLog logs/domain.com-error_log
DirectoryIndex index.html

Alias /static/ /var/www/DjangoBlog/weblog/static/

<Directory /var/www/DjangoBlog/weblog/static>
    Order allow,deny
    Allow from all
</Directory>

<Directory /var/www/DjangoBlog/weblog>
<Files wsgi.py>
    Order allow,deny
    Allow from all
</Files>
</Directory>
</VirtualHost>

即使您在 mod_wsgi 配置中将 Python 路径设置为指向 3.5 站点包,mod_wsgi 本身仍在使用 Python 2.6 或早些时候,它不理解集合文字。

您需要针对 Python 3.5.

编译的 mod_wsgi 版本