title: ImportError: No module named 'decouple' while deploying on Heroku
body: <p>I was trying to deploy my django project on heroku from heroku cli. So I created an app and then I ran <code>git push heroku master</code> from the project directory. Then I got the errors:</p>
  <pre><code>remote: -----&gt; $ python manage.py collectstatic --noinput 
  remote:      Traceback (most recent call last): 
  remote:          File &quot;manage.py&quot;, line 15, in &lt;module&gt; 
  remote:            execute_from_command_line(sys.argv) 
  remote:          File &quot;/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py&quot;, line 371, in execute_from_command_line 
  remote:            utility.execute() 
  remote:          File &quot;/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py&quot;, line 317, in execute 
  remote:            settings.INSTALLED_APPS 
  remote:          File &quot;/app/.heroku/python/lib/python3.5/site-packages/django/conf/__init__.py&quot;, line 56, in __getattr__ 
  remote:            self._setup(name) 
  remote:   File &quot;/app/.heroku/python/lib/python3.5/site-packages/django/conf/__init__.py&quot;, line 43, in _setup remote:            self._wrapped = Settings(settings_module) 
  remote:          File &quot;/app/.heroku/python/lib/python3.5/site-packages/django/conf/__init__.py&quot;, line 106, in __init__ 
  remote:            mod = importlib.import_module(self.SETTINGS_MODULE) 
  remote:          File &quot;/app/.heroku/python/lib/python3.5/importlib/__init__.py&quot;, line 126, in import_module 
  remote:            return _bootstrap._gcd_import(name[level:], package, level) 
  remote:          File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 986, in _gcd_import 
  remote: File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 969, in _find_and_load 
  remote:          File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 958, in
  _find_and_load_unlocked 
  remote:          File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 673, in _load_unlocked 
  remote:          File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 665, in exec_module 
  remote:          File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 222, in _call_with_frames_removed 
  remote:          File &quot;/tmp/build_93c58c906371cd0110470b6bb3ccecc1/funderpreneur/settings.py&quot;, line 15, in &lt;module&gt; 
  remote:            from decouple import Csv, config 
  remote:        ImportError: No module named 'decouple' 
  remote:  
  remote:  !     Error while running '$ python manage.py collectstatic --noinput'. 
  remote:        See traceback above for details. 
  remote:  
  remote:        You may need to update application code to resolve this error. 
  remote:        Or, you can disable collectstatic for this application: remote:  
  remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1 
  remote:  
  remote:        https://devcenter.heroku.com/articles/django-assets 
  remote:  !     Push rejected, failed to compile Python app. 
  remote:  
  remote:  !     Push failed
  </code></pre>
  <p>So as it is mentioned, I ran <code>heroku config:set DISABLE_COLLECTSTATIC=1</code>.
  Then the codes were pushed in the repository. Then I ran <code>heroku run python3 manage.py migrate</code>. But still I got the same error saying:</p>
  <blockquote>
  <p>File &quot;/app/funderpreneur/settings.py&quot;, line 15, in </p>
  <p>from decouple import Csv, config ImportError: No module named 'decouple'</p>
  </blockquote>
  <p>But I have <strong>python-decouple</strong> installed locally for both python 2 and 3. And also the whole project is running on django version 2 and python version 3.5.2. But in the <code>runtime.txt</code> I have set <code>python-3.6.4</code>. I have <code>requirements.txt</code> where <code>decouple</code> is already there.</p>
  <p>In my <code>settings.py</code> I had</p>
  <pre><code>import django_heroku
  django_heroku.settings(locals())
  </code></pre>
  <p>But I was getting errors so I commented them. Still getting error.</p>
  <p>What is wrong or what am I doing wrong?</p>
  <p><strong>Edit</strong></p>
  <p>My <code>requirements.txt</code>:</p>
  <pre><code>dj-database-url
  django
  gunicorn
  psycopg2
  whitenoise
  dj-static
  Unipath
  python-decouple
  Pillow
  Markdown
  bleach
  python-decouple
  django-material
  raven
  django-debug-toolbar
  django-tables2
  django-phonenumber-field
  django-guardian
  django-notifications-hq
  djangorestframework
  matplotlib
  numpy
  seaborn
  pandas
  django-heroku
  </code></pre>
  <p>And the strucutre is:</p>
  <pre><code>.
  ├── core
  │   ├── admin.py
  │   ├── apps.py
  │   ├── __init__.py
  │   ├── migrations
  │   │   ├── __init__.py
  │   │   └── __pycache__
  │   │       └── __init__.cpython-35.pyc
  │   ├── models.py
  │   ├── __pycache__
  │   │   ├── admin.cpython-35.pyc
  │   │   ├── __init__.cpython-35.pyc
  │   │   ├── models.cpython-35.pyc
  │   │   └── views.cpython-35.pyc
  │   ├── templates
  │   │   └── core
  │   │       ├── base.html
  │   │       ├── footer.html
  │   │       ├── index.html
  │   │       ├── login.html
  │   │       ├── navbar.html
  │   │       ├── nav.html
  │   │       ├── partial_settings_menu.html
  │   │       ├── password.html
  │   │       ├── picture.html
  │   │       ├── profile.html
  │   │       └── registration.html
  │   ├── tests.py
  │   ├── urls.py
  │   └── views.py
  ├── db.sqlite3
  ├── funderpreneur
  │   ├── fonts
  │   │   ├── material-design-icons
  │   │   │   ├── Material-Design-Iconsd41d.eot
  │   │   │   ├── Material-Design-Icons.svg
  │   │   │   ├── Material-Design-Icons.ttf
  │   │   │   └── Material-Design-Icons.woff
  │   │   └── roboto
  │   │       ├── Roboto-Bold.ttf
  │   │       ├── Roboto-Bold.woff
  │   │       ├── Roboto-Light.ttf
  │   │       ├── Roboto-Light.woff
  │   │       ├── Roboto-Medium.ttf
  │   │       ├── Roboto-Medium.woff
  │   │       ├── Roboto-Regular.ttf
  │   │       ├── Roboto-Regular.woff
  │   │       ├── Roboto-Thin.ttf
  │   │       └── Roboto-Thin.woff
  │   ├── __init__.py
  │   ├── __pycache__
  │   │   ├── __init__.cpython-35.pyc
  │   │   ├── settings.cpython-35.pyc
  │   │   ├── urls.cpython-35.pyc
  │   │   └── wsgi.cpython-35.pyc
  │   ├── settings.py
  │   ├── static
  │   │   ├── css
  │   │   │   ├── account-settings.css
  │   │   │   ├── bootstrap.min.css
  │   │   │   ├── custom-materialize.css
  │   │   │   ├── footer.css
  │   │   │   ├── high-rise-building.jpg
  │   │   │   ├── materialize.css
  │   │   │   ├── navbar.css
  │   │   │   ├── navbar-top-fixed.css
  │   │   │   ├── style2.css
  │   │   │   └── style.css
  │   │   ├── humans.txt
  │   │   ├── img
  │   │   │   └── buet_logo.png
  │   │   └── js
  │   │       ├── bootstrap.min.js
  │   │       ├── circular-progress-jquery.js
  │   │       ├── jquery-1.11.2.min.js
  │   │       ├── jquery-slim.min.js
  │   │       ├── jquery.waypoints.min.js
  │   │       ├── materialize.js
  │   │       ├── popper.min.js
  │   │       ├── profile-validation.js
  │   │       └── registration-validation.js
  │   ├── urls.py
  │   └── wsgi.py
  ├── manage.py
  ├── media
  ├── Pipfile
  ├── Procfile
  ├── README.md
  ├── requirements.txt
  ├── runtime.txt
  └── staticfiles
  </code></pre>