Issue
I am a beginner web programmer, and I am trying to start learning web app development on Python. I have Python 3.4 and I am using Windows 10. Python works fine when making a game using the pygame modules. Recently, I wanted to try web dev, and so I tried to install Django (along with creating a virtual environment), neither of which I was able to successfully do.
I've already installed pip as shown in the image below.
But for some reason when I enter into Command Prompt this:
C:\Users\Steven>$ pip install Django
I get:
'$' is not recognized as an internal or external command, operable program or batch file.
OR
C:\Users\Steven\>pip install django
I get:
'pip' is not recognized as an internal or external command, operable program, or batch file.
Any kind of help will be greatly appreciated!
Solution
I also faced this issue on windows and here is what helped me. Before executing these commands please make sure that your system environment variable has C:\Python34\ and C:\Python34\Scripts\. Also my Python version was 2.7.12 and I was using windows 8
First install virtualenv (skip if virtualenv is already installed)
python -m pip install virtualenv
Then move to the directory where you want to create a virtual environment and hit this
virtualenv venv
Activate the virtual environment
venv\Scripts\activate.bat
Install Django
pip install django
This should install django in your virtual environment. Now to start a django project the normal django-admin.py startproject did not work for me. This is what worked for me:
python C:\<PATH-TO-VENV-FOLDER>\Scripts\django-admin.py startproject myproject
Hope this helps :)
Answered By - Swapnil Answer Checked By - Candace Johnson (WPSolving Volunteer)