Error creating new project

0 views
Skip to first unread message

Gaston

unread,
Dec 16, 2009, 3:07:28 PM12/16/09
to Django users
Hello,

I'm new to Django and I'm following part 1 of the tutorial. When I try
creating a new project, the following error appears:

$ ~/programming/python/django-trunk/django/bin/django-admin.py
startproject mysite
Traceback (most recent call last):
File "/Users/gafiore/programming/python/django-trunk/django/bin/
django-admin.py", line 2, in <module>
from django.core import management
ImportError: No module named django.core

I've installed Django from SVN following the installation
instructions, and I'm using Mac OS X.

Thanks a lot for your help,

-Gaston

Ales Zoulek

unread,
Dec 16, 2009, 3:41:55 PM12/16/09
to django...@googlegroups.com
You need to have django installed in your pythonpath.

You can see the current python path by running python console and 
import sys
print sys.path

If there's not the directory containing django sources, try adding the directory to the PYTHONPATH system environment variable, or symlink it somewhere to dir in sys.path


A.

------------------------------------------------------
Ales Zoulek
Jabber: ales....@gmail.com
------------------------------------------------------



--

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.



Gaston

unread,
Dec 16, 2009, 4:22:52 PM12/16/09
to Django users
I believe I'm doing that, look at the last entry in the path:

$ python
Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
site-packages/setuptools-0.6c11-py2.6.egg', '/Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/site-packages/
readline-2.6.4-py2.6-macosx-10.3-fat.egg', '/Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/site-packages/pexpect-2.4-
py2.6.egg', '/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/zope.interface-3.5.3-py2.6-macosx-10.3-
fat.egg', '/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/Twisted-9.0.0-py2.6-macosx-10.3-fat.egg', '/
Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', '/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-
darwin', '/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/plat-mac', '/Library/Frameworks/Python.framework/Versions/
2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/lib-tk', '/Library/
Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', '/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-
dynload', '/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages']

I created the symbolic link as follows, with the appropriate
replacement for SITE-PACKAGES-DIR, obviously:

ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django

Unfortunately, I'm still getting the same error.

Thanks for your help,

-Gaston


On Dec 16, 3:41 pm, Ales Zoulek <ales.zou...@gmail.com> wrote:
> You need to have django installed in your pythonpath.
>
> You can see the current python path by running python console and
> import sys
> print sys.path
>
> If there's not the directory containing django sources, try adding the
> directory to the PYTHONPATH system environment variable, or symlink it
> somewhere to dir in sys.path
>
> A.
>
> ------------------------------------------------------
> Ales Zoulek
> Jabber: ales.zou...@gmail.com
> ------------------------------------------------------
>
>
>
> On Wed, Dec 16, 2009 at 9:07 PM, Gaston <gaston.fi...@gmail.com> wrote:
> > Hello,
>
> > I'm new to Django and I'm following part 1 of the tutorial. When I try
> > creating a new project, the following error appears:
>
> > $ ~/programming/python/django-trunk/django/bin/django-admin.py
> > startproject mysite
> > Traceback (most recent call last):
> >  File "/Users/gafiore/programming/python/django-trunk/django/bin/
> > django-admin.py", line 2, in <module>
> >    from django.core import management
> > ImportError: No module named django.core
>
> > I've installed Django from SVN following the installation
> > instructions, and I'm using Mac OS X.
>
> > Thanks a lot for your help,
>
> > -Gaston
>
> > --
>
> > 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<django-users%2Bunsubscribe@google groups.com>
> > .

Abhaya

unread,
Dec 17, 2009, 12:40:48 AM12/17/09
to Django users
Hi Gaston,

I am also pretty new to python. Once I had a similar issue, it turned
out to be permissions on the directories. Since you are creating a
symlink, make sure that all the directories have appropriate
permissions.

Regards,
Abhaya

Ales Zoulek

unread,
Dec 17, 2009, 3:08:30 AM12/17/09
to django...@googlegroups.com
OK.

Try:

ls SITE-PACKAGES-DIR/django

is there a "core", "http", "forms" dirs or dirs like examples, scripts, docs and "django"?

If it's the second case, then you need to symlink one "django" dir deeper:

unlink SITE-PACKAGES-DIR/django
ln -s `pwd`/django-trunk/django/django SITE-PACKAGES-DIR/django
 

Regards,

Ales

------------------------------------------------------
Ales Zoulek
Jabber: ales....@gmail.com
------------------------------------------------------


To unsubscribe from this group, send email to django-users...@googlegroups.com.

Gaston

unread,
Dec 18, 2009, 12:02:46 PM12/18/09
to Django users
Thanks Ales, there were problems with the symlink. Deleting it and
just doing python setup.py install solved the problem. Thanks again
for your help!

-Gaston


On Dec 17, 3:08 am, Ales Zoulek <ales.zou...@gmail.com> wrote:
> OK.
>
> Try:
>
> ls SITE-PACKAGES-DIR/django
>
> is there a "core", "http", "forms" dirs or dirs like examples, scripts, docs
> and "django"?
>
> If it's the second case, then you need to symlink one "django" dir deeper:
>
> unlink SITE-PACKAGES-DIR/django
> ln -s `pwd`/django-trunk/django/django SITE-PACKAGES-DIR/django
>
> Regards,
>
> Ales
> ------------------------------------------------------
> Ales Zoulek

> Jabber: ales.zou...@gmail.com

Reply all
Reply to author
Forward
0 new messages