I'm trying to run this project locally but when i try manage.py makemigrations i keep getting the following error:
ImportError: cannot import name 'config' from 'decouple'
Here are my steps:
I made some research but i found nothing about what could be generating that error. Can anyone help me out on this? Thanks in advance!I'm running Django 3.
You might have decouple installed in additional to python-decouple (two different packages).
If that is the case simply uninstall decouple
pip uninstall decouple
And ensure you have python-decouple installed
pip install python-decouple
It shows the error because you are not installed the module python-decouple
Just run pip install -r requirements.txt
If it won't work then try it in env
pip install python-decouple
I was using pipenv to create a virtual environment and run the Django project
pipenv install -r requiremnts.txt
pipenv shell
python manage.py runserver
Interestingly above method kept throwing error that it cannot import config from decouple
then I tried:
python -m venv myEnv
myEnv/Scripts/activate
pip install -r requirements.txt
python manage.py runserver
and this ran the project successfully. I didnt understand why this would happen as I am doing pretty much same just using pip instead of pipenv.