Getting Started with Mac OS X

311 views
Skip to first unread message

JChlipala

unread,
Feb 27, 2012, 7:36:21 PM2/27/12
to Django users
Hello,

I am a Django beginner, and am trying to get Django set up in Mac OS
X. I am going through the tutorial, but getting stuck very early
(essentially at the beginning). I have installed Python and Django.
The next instruction is to enter the command "django-admin.py
startproject mysite". When I do this, I get the following error:

File "<stdin>", line 1
django-admin.py startproject mysite
^

SyntaxError: invalid syntax

Does anybody know why I am getting this error? The tutorial has a
note for Mac OS X users explaining what to do if you get a "permission
denied" error, but that is obviously not what is happening to me.

Thank you for any help!

Babatunde Akinyanmi

unread,
Feb 28, 2012, 12:59:38 AM2/28/12
to django...@googlegroups.com
I've never used mac OS but try:
python django-admin.py startproject mysite

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

--
Sent from my mobile device

Praveen Rachabattuni

unread,
Feb 28, 2012, 4:08:32 AM2/28/12
to django...@googlegroups.com
Hi,

I am using on Mac OS X Lion and its working pretty well.
Seems there is something wrong with your django installation, try reinstalling 

$ pip uninstall django
$ pip install django

Hope that helps.

Regards,
Praveen R

Tom Evans

unread,
Feb 28, 2012, 6:33:29 AM2/28/12
to django...@googlegroups.com
On Tue, Feb 28, 2012 at 12:36 AM, JChlipala <jason.c...@gmail.com> wrote:
> Hello,
>
> I am a Django beginner, and am trying to get Django set up in Mac OS
> X.  I am going through the tutorial, but getting stuck very early
> (essentially at the beginning).  I have installed Python and Django.
> The next instruction is to enter the command "django-admin.py
> startproject mysite".  When I do this, I get the following error:
>
> File "<stdin>", line 1
> django-admin.py startproject mysite
>                                        ^
>
> SyntaxError:  invalid syntax
>
> Does anybody know why I am getting this error?

You need to type that command at the console command prompt, not the
python prompt.

Cheers

Tom

Clark

unread,
Mar 7, 2012, 9:43:46 AM3/7/12
to Django users
I am having a similar issue, so I tried the $ pip uninstall django,
but I got a "IOError: [Errno 13] Permission denied"

Advice?

Thanks.

On Feb 28, 2:08 am, Praveen Rachabattuni <praveenr...@gmail.com>
wrote:

Tom Evans

unread,
Mar 7, 2012, 9:54:46 AM3/7/12
to django...@googlegroups.com
On Wed, Mar 7, 2012 at 2:43 PM, Clark <ccr...@gmail.com> wrote:
> I am having a similar issue, so I tried the $ pip uninstall django,
> but I got a "IOError: [Errno 13] Permission denied"
>
> Advice?
>
> Thanks.
>

You should have started a new thread for your new error. The error
here was that the new user was typing shell commands into a python
prompt - is that what you are doing?

The error that you have shown means that pip tried to access (read or
delete) a file to which it did not have access. That could happen for
any number of reasons, but most likely you installed django as root
and are trying to uninstall it as a regular user.

Of course, that is just speculation, as you have not shown what
happened, or what your original error was that made you think "I know,
a reinstall of Django will fix everything".

Cheers

Tom

Clark Corey

unread,
Mar 7, 2012, 12:31:30 PM3/7/12
to django...@googlegroups.com
I am typing mine into a shell prompt....I posted the thread, but I don't know that it has posted yet...here it is:

After installing Django I am attempting to start a new project.  After
creating a directory for this, I tried using the command: "django-
admin.py startproject mysite".

but I'm getting the message "-bash: django-admin.py: command not found".

So, I've tried running this:

"sudo ln -s library/python/2.6/site-packages/django/bin/django-admin.py /usr/local/bin/django-admin.py" in which i get "file exists"
and I still get the same problem when running the startproject.

Only other piece of info is that during installation I had a "error: /usr/local/bin/django-admin.py: No such file or directory".  But I can
cd into that directory and see the django-admin.py file.

Thanks!

-Clark


Kayode Alayode

unread,
Jul 13, 2013, 3:25:06 PM7/13/13
to django...@googlegroups.com, jason.c...@gmail.com
Yea I think they wanted you to add this "django-admin.py
startproject mysite
"  at the cd commandpromopt I am stuck here as well and don't really know how to proceed as well.

Mando

unread,
Jul 14, 2013, 4:26:24 PM7/14/13
to django...@googlegroups.com, jason.c...@gmail.com
Hi,

This is the way I have it set up my osx


$ sudo pip install virtualenv
$ virtualenv --distribute pytho_projects
$ source python_projects/bin/activate
$ (python projects) pip install django
$ django-admin.py startproject myblog

and that should get you past that. using virtualenv just makes it a lot more clean and organized imo. Let me know if that helped you out some.

Thomas Lockhart

unread,
Jul 14, 2013, 4:30:25 PM7/14/13
to django...@googlegroups.com, jason.c...@gmail.com
On 7/14/13 1:26 PM, Mando wrote:
Hi,

This is the way I have it set up my osx


$ sudo pip install virtualenv
$ virtualenv --distribute pytho_projects
$ source python_projects/bin/activate
$ (python projects) pip install django
$ django-admin.py startproject myblog

and that should get you past that. using virtualenv just makes it a lot more clean and organized imo. Let me know if that helped you out some.

+1 on that. pip is the only way to go.

And I would suggest installing PostgreSQL from MacPorts or an equivalent package manager to give yourself more control over your database versioning and contents. Otherwise you are relying on whatever is in Apple's current update which may change or be different from what you might need for reasons of your own.

I've also installed python and related packages from MacPorts so then the virtualenv will point to that installation when it initializes. That also gives you more control over versioning.

hth

                           - Tom





On Saturday, July 13, 2013 2:25:06 PM UTC-5, Kayode Alayode wrote:
Yea I think they wanted you to add this "django-admin.py
startproject mysite
"  at the cd commandpromopt I am stuck here as well and don't really know how to proceed as well.


On Monday, February 27, 2012 7:36:21 PM UTC-5, JChlipala wrote:
Hello,

I am a Django beginner, and am trying to get Django set up in Mac OS
X.  I am going through the tutorial, but getting stuck very early
(essentially at the beginning).  I have installed Python and Django.
The next instruction is to enter the command "django-admin.py
startproject mysite".  When I do this, I get the following error:

File "<stdin>", line 1
django-admin.py startproject mysite
                                        ^

SyntaxError:  invalid syntax

Does anybody know why I am getting this error?  The tutorial has a
note for Mac OS X users explaining what to do if you get a "permission
denied" error, but that is obviously not what is happening to me.

Thank you for any help!
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages