Answer the question
In order to leave comments, you need to log in
Django not available from python3?
Good afternoon
OS debian8, I installed django via pip3
from Python 2.7.9 when I enter the import django command, no errors occur,
but when I enter the same command from python 3.5.2, an error occurs
import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'django'
Answer the question
In order to leave comments, you need to log in
Your python2 libraries are located in a directory (/usr/lib64/python/site-packages) different from python3 (/usr/lib64/python3/site-packages).
I will offer several solutions:
1. Fast:
cd $PROJECT_DIR
cat "./env" > .gitignore
python3 -m venv env
source ./env/bin/activate
pip install django
solved the problem by reinstalling the system on ubuntu, everything was installed there without problems
I use as a version manager of python and the necessary libraries for the project under development --> Anaconda - https://www.continuum.io/downloads
1. on the command line - conda create -n name(virtual environment name) python=?.?( python version required)
2. on the command line - source activate name(virtual environment name) --> activate the virtual environment.
3. here are two ways to install the necessary packages, pip install [name] or conda install [name].
ps If you are working with Postgresql --> the conda install psycopg2 command installs the package and all dependencies perfectly and no need to dance with a tambourine :-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question