0

My code (python) works perfectly in local but not when I deploy it on Heroku.

This is the error

Anas
  • 3
  • 1
  • 2
  • **1.** Don't post links to external sites for error messages you get. **2.** If the logs are huge (like in your case), paste the relevant parts of the log here and then a link separately, called "log" rather than _"This is the error"_. **3.** You've got a file called **`collections.py` in your `/app` folder**. So it's trying to import it from there rather than the actual python-`collections` module. Rename yours to not clash with the names of python modules. Like `my_collections.py` and retry. **4.** If you made any path/SYSPATH changes, you should mention that. – aneroid Jun 11 '22 at 11:56
  • 2
    Possible duplicate of [Importing installed package from script raises "AttributeError: module has no attribute" or "ImportError: cannot import name"](https://stackoverflow.com/questions/36250353/importing-installed-package-from-script-raises-attributeerror-module-has-no-at) – pppery Jun 11 '22 at 19:45

1 Answers1

0

You've got a file called collections.py in your /app folder. So it's trying to import it from there rather than the actual python-collections module. Rename yours to not clash with the names of python built-in modules, like my_collections.py, and retry.

aneroid
  • 12,983
  • 3
  • 36
  • 66