0

I have a problem in the virtual environment with django manage.py I use git bash terminal. and when I activate my venve like this :

source explorer/Scripts/activate

I successfully activate the environment (explorer text above command line appears) , but still the terminal is pointing to the C:/python37/python.exe path

When i run :

python manage.py runserver

I receive this error :

$ python manage.py runserver Traceback (most recent call last): File "manage.py", line 11, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

but when I type the absolute path to python.exe inside my virtual environment as follows :

/explorer/Scripts/python.exe manage.py runserver

, it works fine

I should be just activating the environment and then typing the python manage.py runserver and it should be working

Thanks in advance

  • Did you install django in your venv? And, if you are using python 3 you should write python3 manage.py runserver. I wait for an answer so I can help you further since the question is relatively unlcear. – Spartan 117 Dec 12 '21 at 10:48
  • yes , Django is installed in my env. I believe the problem is that the git bash terminal is not pointing to the python inside the virtual env, rather than it is pointing towards the root python – Moe Ashraf Dec 12 '21 at 11:45
  • I think you could find this answer useful: https://stackoverflow.com/questions/29911962/python-virtualenv-does-not-use-correct-version-of-python – Spartan 117 Dec 13 '21 at 10:46

0 Answers0