简体   繁体   中英

python3.5 Error installing Django1.9.6: syntax error

When I call server.apache error log. I try to solve it but I failed. Hope anybody can help me. Thank you very much.

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

this is my python version.

 python -V
 Python 3.5.1

this is my 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>

Even though you have set the Python path within your mod_wsgi configuration to point to the 3.5 site-packages, mod_wsgi itself is still using Python 2.6 or earlier, which does not understand set literals.

You need a version of mod_wsgi compiled against Python 3.5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM