Run Django 1.9 on Python 3.5 instead of 2.7 -


i have python 2.7 , 3.5 running on osx 10.10 , django 1.9a -- support both python version. problem want run django on python 3.5 instead of 2.7. on threads found suggestions run including python version e.g: python3.5 manage.py runserver, found error:

file "manage.py", line 8, in <module> django.core.management import execute_from_command_line importerror: no module named 'django'

fyi, have no problem run python3.5 on same machine.

how can solve this? thank much!

note: when wrote this, django 1.9 had not yet been released, , django 1.8 did not support python 3.5. since then, django 1.9 has been released, , django 1.8.6+ supports python 3.5. therefore can use latest 1.8.x or 1.9.x python 3.5. choose django 1.8.x if want long term support, or 1.9.x if want newer features.

the django docs recommend create virtual environment version of python wish use, install django using pip.

on os x, pyvenv installed along python 3.

pyvenv djangodev # create virtual env.   source djangodev/bin/activate # activate pip install django 

this install latest stable version of django, 1.8.4. django 1.9 alpha has been released. if new django, might have smoother ride if start python 3.4 , django 1.8. straight forward upgrade later. if want install 1.9 alpha, can install using pip

pip install django==1.9a1 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -