<<No module named django.core >> - Django Installation

A forum for general discussion of the Python programming language.

<<No module named django.core >> - Django Installation

Postby 47box » Mon Apr 07, 2014 4:59 pm

Hi,

I´m having problems with Django installation.

Usually I have 3 partition on my machine (C:\ - OS + Y:\ +......)

I have the OS(Win8) installed at my Y:\ partition (Y:\Python27)

Inside my main installation (Y:\Python27) I´ve been installing the mudules below.:
PIP 1.5.4
setuptools 3.4.2
virtualenv 1.11.4
distribute 0.7.3

When I installed "virtualenv", I´ve been creating inside my Y:\ partition a folder called "Projects" (that was the command I wrote to create a folder: >> virtualenv --no-site-packages Projects )

After that I activated the virtual environment and I ran the command to install Django (pip install django)

After django installation I run the "dir" command (inside the virtual environment created) to see the folders inside the "Projects" folder (<Projects>Y:\Projects).......and I got the following folders:

Include
Lib
Scripts

I found the "django-admin.py inside the Scripts folder. Than I went to Environment Variables and added to the System Variables (Path ) the following line (bold line):

Y: \ Program Files ( x86 ) \ ActiveState Komodo IDE 8 \ C: \ Program Files ( x86 ) \ NVIDIA Corporation \ PhysX \ Common C: \ Program Files ( x86 ) \ Intel \ ICLs Client \ C: \ Program Files \ Intel \ ICLs Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files \ Intel \ Intel ( R) Management Engine Components \ DAL C: \ Program Files \ Intel \ Intel ( R) Management Engine Components \ IPT C: \ Program Files ( x86 ) \ Intel \ Intel ( R) Management Engine Components \ DAL C: \ Program Files ( x86 ) \ Intel \ Intel ( R) Management Engine Components \ IPT C: \ Program Files \ Microsoft SQL Server \ 110 \ Tools \ Binn \ , Y : \ Python27 ; Y: \ Python27 \ Scripts; Y: \ Projects\Scripts ;

I went back to the CMD and inside the Virtual Environment (<Projects>Y:\Projects\Scripts) I ran the command: django-admin.py and I got the following message:


Code: Select all
" " " " " " " " Traceback ( most recent call last ) :
          File " Y : \ Projects \ Scripts \ django - admin.py " , line2 , in <module>
                From django.core import management
         Import Error : No module named django.core "" " " """"""


Just to let you know, I ran the command "pip list" inside the virtual environmet (<Projects>Y:\Projects) and I got the following modules installed.:
Django 1.6.2
pip 1.5.4
setuptools 2.2

what am I doing wrong?

Tks friends.
Last edited by stranac on Mon Apr 07, 2014 5:02 pm, edited 1 time in total.
Reason: Added code tags. Locked.
47box
 
Posts: 5
Joined: Mon Apr 07, 2014 2:51 pm

Re: <<No module named django.core >> - Django Installation

Postby 47box » Mon Apr 07, 2014 5:36 pm

Just correcting one line I wrote wrong at the first post:

I have the OS(Win8) installed at my C:\ and I´ve been installing Python27 inside my Y:\ partition (Y:\Python27)

Tks.
47box
 
Posts: 5
Joined: Mon Apr 07, 2014 2:51 pm

Re: <<No module named django.core >> - Django Installation

Postby micseydel » Mon Apr 07, 2014 5:59 pm

Do you have a Python file of your own called django.py? If not, could you post the out of this code?
Code: Select all
import django
print django.__file__
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1292
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: <<No module named django.core >> - Django Installation

Postby 47box » Mon Apr 07, 2014 6:50 pm

Y:\Project\scripts\activate
<Project> Y:\Project >> python

Python 2.7.6 (default, Nov 10 2013, 19:24:18)................
>>import django
>>print django.__file__
Y:\Project\lib\site-package\django\__init__.pyc
47box
 
Posts: 5
Joined: Mon Apr 07, 2014 2:51 pm

Re: <<No module named django.core >> - Django Installation

Postby 47box » Tue Apr 08, 2014 12:16 pm

I got the "django-admin.py" command running well after install Django inside my mean Python27 (Y:\Python27) roots location.
After that I got inside my virtual environment (<Projects>Y:\Projects) and I´ve been running the command "django-admin.py".........I got the subcommands and everything ran fine.

My question is.:

Before I had django only installed inside my virtual environment (<Projects>Y:\Projects) and I did not get the command ("django-admin.py") running (that is why I started the post).
After django installation inside the mean Python27 path (Y:\Python27) I could run the command ("django-admin.py") inside my virtual environment with no problems.

Is my procedure correct? Need I have the django installed inside my mean Python27 installation (Y:\Python27) and inside the virtual environment (<Projects>Y:\Projects) I created to make it happen?

That was the unique way I got to make it works.
47box
 
Posts: 5
Joined: Mon Apr 07, 2014 2:51 pm

Re: <<No module named django.core >> - Django Installation

Postby 47box » Wed Apr 09, 2014 5:43 am

Hi,

Nobody can give a way that I can find the problem?
47box
 
Posts: 5
Joined: Mon Apr 07, 2014 2:51 pm

Re: <<No module named django.core >> - Django Installation

Postby 7stud » Sat Apr 19, 2014 4:00 am

Need I have the django installed inside my mean Python27 installation (Y:\Python27) and inside the virtual environment (<Projects>Y:\Projects) I created to make it happen?

Well, no. The whole point of a virtual environment is to create a self contained box where you install modules with the specific versions you want....to create your environment. Anything outside the box should be irrelevant.

Code: Select all
virtualenv --no-site-packages

I can find no information on google for the virtualenv flag: --no-site-packages. Where did you get that from?

I would try reading the following two documents to see if they can help you successfully create a virtualenv on windows:

http://docs.python-guide.org/en/latest/ ... stall/win/
http://virtualenv.readthedocs.org/en/la ... alenv.html

And if you can, try to install virtualenvwrapper, which is a program designed to make controlling virtualenv easier.

Also, there are many results on google for that specific error on windows. Start reading them.
7stud
 
Posts: 95
Joined: Wed Apr 02, 2014 2:36 am

Re: <<No module named django.core >> - Django Installation

Postby stranac » Sat Apr 19, 2014 9:08 am

7stud wrote:I can find no information on google for the virtualenv flag: --no-site-packages. Where did you get that from?

Code: Select all
virtualenv --help
Usage: virtualenv-script.py [OPTIONS] DEST_DIR

Options:
...
  --no-site-packages    Don't give access to the global site-packages dir to
                        the virtual environment (default)
...

It used to not be the default, so it can still be found in the online tutorials.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1135
Joined: Thu Feb 07, 2013 3:42 pm


Return to General Discussions

Who is online

Users browsing this forum: MattTuck and 2 guests