Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCristy Lucke
Courses Plus Student 3,040 PointsCreate project command gives me error django-admin: command not found
When I try to execute one of the first commands of the video to create a project,
django-admin startproject learning_site
I get the error:
-bash: django-admin: command not found
This is a real blocker. I've googled around and found quite a lot of different advice (such as needing to spin up a virtualenv and run source bin/activate?), but nothing that has worked yet. It seems strange that anything too involved would be required that the video isn't covering though.
Thanks!
1 Answer
Flore W
4,744 PointsHi, I've run into the same issue, and managed to get it to work without the source bin/activate line.
I am using PyCharm Community Edition, clicked on File > New Project, selected New environment using Virtualenv, and Create.
It creates the Virtual Env automatically, so you just need to pip install Django before typing the line django-admin startproject learning-site
I wonder if I need to enter "pip install Django" for every new project or if there is a way to by pass that since Django is already installed. (I know that the Professional edition of PyCharm let you choose the Project Type from the step where you Create a New Project, but is there a way to do that in the Community Edition?)
Cristy Lucke
Courses Plus Student 3,040 PointsCristy Lucke
Courses Plus Student 3,040 PointsOh wait, I think I got it to work! I had to do:
pip install virtualenv
virtualenv <some_name>
and then cd into the <some_name> directory and run:
source bin/activate
pip install Django
After that, I was able to successfully execute "django-admin startproject learning_site" without the error.
Anyone know why I had to do these extra steps that weren't covered in the video?
BTW: I did figure out that if I used the built-in Workspaces in Treehouse that I don't have this problem. He does briefly mention that you have to use virtualenvs if you don't use the Workspaces. I wish they'd covered this more in-depth in the setup part of the course though.