Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - cannot import name 'config' from 'decouple'

Tags:

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:

  1. Clone the repository from github
  2. Create a virtual environment
  3. Install the dependencies

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.

like image 677
Jack022 Avatar asked Jun 25 '20 16:06

Jack022


People also ask

Could not import config from decouple?

Importerror: cannot import name 'config' from 'decouple' (Cause and Fix ) – The cause is pretty clear for this error is misplacing the package decouple and python-decouple both. The simple way to fix this error is by uninstalling this decouple package and after that installing python-decouple package.


1 Answers

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
like image 78
David Gibson Avatar answered Sep 19 '22 16:09

David Gibson