While deploying in Heroku and adding customized buildpacks such as libspatialindex, another error occurred where Python 3.5 now looks for Tkinter.
Locally, by installing using sudo apt-get tk-dev
this would be solved and trying out the suggestion from this similar problem: import matplotlib failing on Heroku, the error still persists.
Here are my buildpacks:
https://github.com/heroku/heroku-buildpack-apt
heroku/python
https://github.com/julienfr112/libspatialindex-buildpack.git
And my Aptfile containing only:
python3-tk
libpq-dev
build-essential
libncursesw5-dev
libreadline5-dev
libssl-dev
libgdbm-dev
libc6-dev
libsqlite3-dev tk-dev
libbz2-dev
On Heroku push here's the tail of the log:
2017-09-05T08:25:58.903075+00:00 app[web.1]: File "/app/.heroku
/python/lib/python3.5/site-packages/six.py", line 82, in _import_module
2017-09-05T08:25:58.903076+00:00 app[web.1]: __import__(name)
2017-09-05T08:25:58.903076+00:00 app[web.1]: File "/app/.heroku
/python/lib/python3.5/tkinter/__init__.py", line 35, in <module>
2017-09-05T08:25:58.903076+00:00 app[web.1]: import _tkinter
# If this fails your Python may not be configured for Tk
2017-09-05T08:25:58.903077+00:00 app[web.1]: ImportError: No module
named '_tkinter'
Any ideas?