我正在和Django一起学习Python.我最初在我的机器上安装了Python 3(Debian Wheezy),但是阅读了有关可能的冲突并将其删除有些困难.
现在我正在使用virtualenv并使用pip在env和Django中安装python3.Django和Python似乎已正确安装:
# python -c "import django; print(django.get_version())"
1.9.1
# python -V
Python 3.2.3`
但是当我尝试启动一个新的Django项目时,我得到以下内容:
# django-admin.py startproject mysite
Traceback (most recent call last):
File "/home/rialaado/Projects/webenv/bin/django-admin.py", line 2, in
from django.core import management
File "/home/rialaado/Projects/webenv/lib/python3.2/site-packages/django/core/management/__init__.py", line 10, in
from django.apps import apps
File "/home/rialaado/Projects/webenv/lib/python3.2/site-packages/django/apps/__init__.py", line 1, in
from .config import AppConfig
File "/home/rialaado/Projects/webenv/lib/python3.2/site-packages/django/apps/config.py", line 6, in
from django.utils.module_loading import module_has_submodule
File "/home/rialaado/Projects/webenv/lib/python3.2/site-packages/django/utils/module_loading.py", line 67, in
from importlib.util import find_spec as importlib_find
ImportError: cannot import name find_spec
一个快速的谷歌出现没有任何可以帮助我的结果.
我该怎么办?
find_spec
在Python 3.2.3中不可用; 它是在Python 3.4中添加的.
尝试升级到3.4或更高版本.