DEV Community

aliplutus
aliplutus

Posted on

why Django loss it's dependencies.

I made a few django+react websites before. But, they work very fine for a while and later after I run few git commits and many other change the Django backend start showing errors like " there is no module named Django" or "there is no module named django-allauth" despite I installed all of them before and the website was working very well.
Could that be because of the environment? what if I used docker could it help to prevent such things? or it may be a problem with code only?

Latest comments (3)

Collapse
 
corentinbettiol profile image
Corentin Bettiol

You may need to source your virtual environment before working with your website :

python3 -m venv .venv # create a virtual environment folder named .venv
. .venv/bin/activate # source the environment, using "python3" should now use the python3 executable inside the environment
python3 -m pip install -r requirements.txt # install all the requirements inside the virtual environment (and not on the default folder in the host system)
Enter fullscreen mode Exit fullscreen mode

The important command here is . .venv/bin/environment :)

Collapse
 
pontakornth profile image
Pontakorn Paesaeng

How do you install the dependencies?

Collapse
 
aliplutus profile image
aliplutus

pipenv install django...
or pip3 install django