ImportError: No module named 'decouple' while deploying on Heroku ImportError: No module named 'decouple' while deploying on Heroku python-3.x python-3.x

ImportError: No module named 'decouple' while deploying on Heroku


I also had this problem, but by adding

python-decouple==3.1

into the requirements.txt file, I was able to get past it!


I think you haven't written packages name from requirements.txt to the Pipfile bellow [packages] section. You should add packages in this format-

package_name = "version"


I had an error similar to this, turns out you have to install the module in the virtual environment. First, launch the virtual environment, then install the module(inside the virtual environment). Now try to launch your server, the problem should be solvedIn some cases, there might be a module "decouple' installed, uninstall that module before launching your server as it will cause an error