-1

I downloaded the necessary files from the link https://github.com/django/django.git and pasted them in to my virtual env directory

After setting up and activating the virtualenv, when I run the following command:

$ pip install -e django/

It produces this error:

(ENV) C:\WINDOWS\system32>pip install -e django/ django/ should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

I am a Windows user. I think the command is for bash not for cmd.

Is it necessary to use this git tool to finally work with django ?

As instructed on the Django website :

As instructed on the Django website

LuFFy
  • 8,799
  • 10
  • 41
  • 59
  • 2
    Why are you installing the development version at all? You're clearly new to Django and development, so you should follow [the instructions to install a released version](https://docs.djangoproject.com/en/2.0/topics/install/#install-the-django-code). – Daniel Roseman Feb 07 '18 at 09:41
  • (That error is because you didn't follow the instructions properly; you shouldn't be in the WINDOWS\system32 directory, for a start. You don't need git to install Django, but you *do* need git or a similar tool to do any actual development. But, again, these are not the instructions you should be reading at this point.) – Daniel Roseman Feb 07 '18 at 09:43

2 Answers2

2

If you're just starting out with Django development I'd recommend looking at some YouTube videos before jumping into the Django docs. Personally when I was starting out I found that the docs were quite hard to understand in the beginning, but as you get better you can refer back to them more and more.

Here's a good beginner video series to get you started.

In any case, I would recommend using virtualenvwrapper-win so that you can work on multiple Django projects without any conflicts.

First, ensure that you have added Python to the Windows environment. Open CMD and run pip install virtualenvwrapper-win.

Then cd to whichever directory your project files will be in and run mkvirtualenv projectname.

Finally run setprojectdir path/to/folder

Now whenever you want to enter that virtual environment and work on your project all you have to do is run the command workon projectname and it'll do the rest for you. You'll know it worked if on each new line in the command prompt it gives you (projectname) in brackets.

To actually install Django all you need to run is pip install django while in the virtual environment.

DDiran
  • 533
  • 1
  • 6
  • 23
  • I was happy to see a civilized answer as opposed to the above comments which are rather terse and presumptuous on the OP's intent. Personally, I ran into this exact problem, but for me it was a case of not paying attention to where I was in the documentation. – lee Jun 18 '19 at 20:53
  • thanks @lee, I find SO can be quite a hostile environment sometimes, especially when you're just starting out and don't know how to correctly format questions & research other Q&A before posting. Glad to hear you got it all working! – DDiran Jun 19 '19 at 08:29
0

From your question, I suppose that you are trying to install django inside your virtual directory. If that is correct you dont need to get it from git. Alternate way is to create a directory "main" and then project directory "mydjangoproject" inside it and a virtual environment "env".

C:\>mkdir main
C:\>cd main
C:\main>mkdir mydjangoproject
C:\main>virtualenv env

Now activate the virtual environment.

C:\main>env\Scripts\activate

Then install all the package in it. e.g

(env) C:\main>pip install django
Cube
  • 31
  • 1
  • 6