On Wed, Aug 22, 2012 at 5:00 PM, Bestrafung <musicfa...@gmail.com> wrote:

> I'm new to Django and though I've dabbled with Linux off and on for a
> decade I'm still learning so please go easy on me. I'm following this
> guide<http://blog.perplexedlabs.com/2008/11/10/setup-python-25-mod_wsgi-and-django-10-on-centos-5-cpanel/>to
>  setup a Django 1.4.1 test project. So far I've setup Python 2.5 with
> MySQL-python-1.2.3 and setuptools, setup mod_wsgi, and edited
> .bash_profile. I've downloaded Django 1.4.1 (not trunk) and so far
> everything looks good. As soon as I run "django-admin.py startproject
> testproject" I receive an error and am having trouble resolving it. I
> apologize if this has come up before bet a quick search wasn't helpful.
> Thanks in advance for any assistance, the error is below:
>
> [-bash-3.2 root@server1: /home/username/sites/domain.com] #
> /home/username/sites/domain.com/django/bin/django-admin.py startproject
> testproject
> Traceback (most recent call last):
>   File "/home/username/sites/domain.com/django/bin/django-admin.py", line
> 2, in ?
>     from django.core import management
>   File "/home/username/sites/domain.com/django/__init__.py", line 15
>     parts = 2 if version[2] == 0 else 3
>                ^
> SyntaxError: invalid syntax
> [-bash-3.2 root@server1: /home/username/sites/domain.com] #
>
> That error indicates the python executable processing django-admin.py is
Python 2.4 level, not 2.5. With Python 2.5 I can import django at level
1.4.1:

kmt@lbox 20:04:15: ~/software/web
--> python
Python 2.5.2 (r252:60911, Jan 20 2010, 23:16:55)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> quit()

If I try with Python 2.4 level, I get the error you are seeing:

kmt@lbox 20:04:45: ~/software/web
--> python2.4
Python 2.4.5 (#2, Jan 21 2010, 19:44:35)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/kmt/django/Django-1.4.1/django/__init__.py", line 15
    parts = 2 if version[2] == 0 else 3
               ^
SyntaxError: invalid syntax
>>>

You may have python 2.5 installed, but you seem to have 2.4 also, and 2.4
is what's getting used for the command you are running.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to