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 trialAnshu Aradhyula
4,317 PointsDjango manage.py differs from video
1.Used virtualenv to make python3 environment and activated it. 2.pip3 install django....it worked and installed lates version 3.django-admin.py startproject learning_site made directory. Inside is manage.py
<where the problem lies> manage.py script doesn't match. the first line had the path from python2 instead of 3. and there was a try catch exception statement. Just to move on i changed the path to my python3 but idk if django is going to try to use python2 still.
<what I think is the problem> maybe virtualenv isn't using python3? I named my virtualenv as firstdjango.
firstdjango>bin shows: pip pip2 python python2 python2.7
Please tell me if you have a different idea as to why this is. Sorry for long post. Thanks!
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsSometime virtualenv
will use the default python found on the system (which may have been python2) unless expressly told otherwise with the -p
switch:
virtualenv --python=<your path to py3>/python3 <name of env>
You can verify which python is within the virtualenv by activating the venv and then launching an interactive python session. The version displayed is the one installed in the venv.