ImprtError in Django

202 views Asked by At

When I try to run my projects server i get this error:

File "manage.py", line 14, in <module>
import django
File "C:/.../.../.../..../..."
from django.utils.version import get_version
ImportError: No module named utils.version

Help, Please.

1

There are 1 answers

0
d2718nis On BEST ANSWER

It is definitely a PATH issue. This may happen if you've installed Django as one user and trying to run your django web app as another one. The best way is to use virtualenv as xyres mentioned in the comments above.

  1. Install virtualenv from cmd.exe, run it as an Administrator

    pip install virtualenv

  2. Create your own virtual environment

    virtualenv .venv

  3. Activate virtual environment on Windows

    .venv/Scripts/activate.bat

  4. Or if you're using Linux

    source .venv/bin/activate

  5. Now you can install dependencies with pip as a part of your virtual environment

    pip install -r requirements.txt

    pip install django

  6. You can exit virtual environment at any moment by typing

    deactivate