Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django 1.8 does not work on CentOs 6.5 server

Installing collected packages: Django
Successfully installed Django-1.8
[root@manage ~]# PYTHON
-bash: PYTHON: command not found
[root@manage ~]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "/usr/lib/python2.6/site-packages/django/utils/version.py", line 7, in <module>
from django.utils.lru_cache import lru_cache
File "/usr/lib/python2.6/site-packages/django/utils/lru_cache.py", line 28
fasttypes = {int, str, frozenset, type(None)},
                ^
SyntaxError: invalid syntax
>>>

hello ,I am new to Django and CentOS ,,I just install django 1.8 by pip successfully,,but when I try to import django in python shell ,,it shows the error message above,,,can any one tell me what's happening?? thank you !

like image 744
Joe Lin Avatar asked Mar 10 '26 15:03

Joe Lin


2 Answers

Django 1.8 requires Python 2.7, 3.2, 3.3, 3.4, or 3.5.

https://docs.djangoproject.com/fr/1.9/releases/1.8/#python-compatibility

like image 63
bruno desthuilliers Avatar answered Mar 12 '26 07:03

bruno desthuilliers


Django 1.8 does not work on Python 2.6. You need to install Python 2.7 or Python 3.2-3.5. See the FAQ for all supported versions.

Alternatively, if you can't upgrade Python, you can take a look at this unofficial fork of Django 1.6: https://github.com/beanbaginc/django

like image 39
knbk Avatar answered Mar 12 '26 08:03

knbk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!