After installing django in virtual environment, still can't import module

I am trying to use django for web dev, but after I install it, I try to use import it in the interpreter and it says it gives me an import error. Here is what I do.

virtualenv venv --distribute
source venv/bin/activate

so now I am in the virtual environment (venv)

pip install django
python
import django

Then I get an ImportError

import django Traceback (most recent call last): File "", line 1, in ImportError: No module named 'django' import django Traceback (most recent call last): File "", line 1, in ImportError: No module named 'django'


Original poster here.

I installed django using pip so it was in the python 2.7 binaries while i was working with python 3.5.

Using pip3 install django solved it.

链接地址: http://www.djcxy.com/p/67244.html

上一篇: Scapy TCP RST atack

下一篇: 在虚拟环境中安装django后,仍然无法导入模块